Skip to content
Advertisement

xattr: ImportError: No module named pkg_resources

I was trying to run xattr on macOS Catalina 10.15.2 and the error occurred:

JavaScript

So I tried the solution given by @cwc and installed the latest version of setuptools

JavaScript

I also installed setuptools using pip3

JavaScript

Besides, I tried the methods above in different conda environments with Python 3.6.10 and 3.7.4, but the problem was not solved. Any ideas as to this problem?

Advertisement

Answer

xattr as included in Catalina uses the system-installed Python 2.7. (As shown by the head command below.) So you need to make sure that version is set up correctly.

JavaScript

Make sure python is using the system default version:

JavaScript

Then, run the following commands

JavaScript

Using pip in this way means that the the module is being run from site-packages directly, and will not clobber any other pip on your system (i.e. from Python 3.7)

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement