2017-05-22 105 views
0

這裏是我的外殼的輸出:爲什麼不是pip下載virtualenv?

Hannahs-MacBook-Pro:Downloads hannah$ pip install virtualenv 
Collecting virtualenv 
    Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB) 
    100% |████████████████████████████████| 1.8MB 195kB/s 
Installing collected packages: 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' 
+0

使用'sudo pip ...'或'pip install --user ...' – kichik

+0

您還沒有特權,請嘗試使用'''sudo pip install virtualenv''' –

回答

2

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'

您沒有安裝權限,使用sudo pip install virtualenv

無論何時出現此錯誤IOError: [Errno 13] Permission denied:,這意味着您需要使用sudo

3

您需要root權限才能安裝(或更新)virtualenv,嘗試:

sudo pip install virtualenv