mac下pip安装virtualenv失败

yorickshan
  • 113

macos 10.12
python 2.7.10

详细:

bogon:bin agdragon$ pip install virtualenv
Downloading/unpacking virtualenv
  Downloading virtualenv-15.0.3-py2.py3-none-any.whl (3.5MB): 3.5MB downloaded
Installing collected packages: virtualenv
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 671, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 901, in move_wheel_files
    pycompile=self.pycompile,
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/wheel.py", line 207, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/wheel.py", line 194, in clobber
    os.makedirs(destsubdir)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv-15.0.3.dist-info'

Storing debug log for failure in /Users/agdragon/Library/Logs/pip.log
bogon:bin agdragon$ 
回复
阅读 4.3k
1 个回答
✓ 已被采纳

权限不够啊。。麻烦问这种问题之前能不能看下debug的报错信息呢?
如果你使用sudo pip install 也无法安装

那么可以进入macos的recovery os 关闭rootless之后再尝试
http://www.pc6.com/edu/86809....

宣传栏