Je veux entrer dans l'environnement virtuel créé par virtualenv warapper avec la commande workon.
$ workon myvenv(Nom de l'environnement virtuel)
Je devrais pouvoir saisir ceci, mais j'obtiens l'erreur suivante.
File "/System/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 "/System/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
ImportError: No module named stevedore
Traceback (most recent call last):
File "/System/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 "/System/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
ImportError: No module named stevedore
Je peux accéder à l'environnement virtuel, mais j'obtiens une erreur. Apparemment, il n'y a pas de module appelé stevedore.
Environnement de travail: macOS Sierra version 10.12.5 Python 2.7.10 virtualenv 15.1.0 virtualenvwrapper 4.7.2
Installez stevedore.
$ sudo pip install stevedore
J'obtiens également une erreur.
Collecting stevedore
Downloading stevedore-1.25.0-py2.py3-none-any.whl
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /Library/Python/2.7/site-packages (from stevedore)
Collecting six>=1.9.0 (from stevedore)
Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, stevedore
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/7t/313m_dg1067bhtr2llqd0q9cz8c4fj/T/pip-KG9_ld-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
Quand j'ai recherché, il semble que la cause était que six étaient déjà inclus. Essayez de réinstaller avec la commande suivante.
$ sudo pip install stevedore --upgrade --ignore-installed six
L'erreur a maintenant disparu.
http://qiita.com/kawashinji/items/98fd8a917a17c3476091 https://github.com/pypa/pip/issues/3165
Recommended Posts