I got the below issue when trying to setup virtualenvwrapper on a new laptop(worked ok on a previous one).
Last login: Tue Aug 18 17:03:39 on ttys001
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Library/Python/2.7/site-packages/virtualenvwrapper/hook_loader.py", line 16, in <module>
from stevedore import ExtensionManager
File "/Library/Python/2.7/site-packages/stevedore/__init__.py", line 11, in <module>
from .extension import ExtensionManager
File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 4, in <module>
import pkg_resources
ImportError: No module named pkg_resources
virtualenvwrapper.sh: There was a problem running the initialization hooks.
Not sure whey there are no pkg_resources but I tried to solve by installing with:
sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | python
which gave me this error:
Installing Setuptools
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/test-easy-install-3286.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://pythonhosted.org/setuptools/easy_install.html
Please make the appropriate changes for your system and try again.
Something went wrong during the installation.
Any ideas why it couldn't install when I used sudo? Thanks