通过Mac OS X终端使用PIP for Python安装虚拟环境

时间:2016-12-17 03:30:10

标签: python macos terminal pip

所以,这只是一个简单的问题。我在Mac OS X终端上通过Homebrew安装了Pip for Python。我试图做的下一件事是通过pip install virtualenv安装虚拟环境 - 这就是我遇到问题的地方。我收到以下错误消息:

 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 784, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'

任何人都知道该怎么办? 我是这一切的新手,所以我完全不知道该怎么做。

感谢。

1 个答案:

答案 0 :(得分:0)

你见过http://softwaretester.info/install-and-upgrade-pip-on-mac-os-x/ 这可能对你有帮助,我是Windows用户,所以它的命令就像 pip install package-name ,但是你必须在windows中的 python27的脚本文件夹中出现,但我不会这样做。知道mac-os-x。这样做也会将目录更改为 python27 / scripts ,然后使用你的pip命令

如果这有助于你。支持竖起大拇指