错误:无法创建’/usr/local/lib/python2.7/dist-packages/virtualenv_support’:权限被拒绝

我使用ubuntu 12.04和我试图pip安装virtualenv但突然,我得到这个错误。

samuel@sampc:~$ pip install virtualenv
Downloading/unpacking virtualenv
  Running setup.py egg_info for package virtualenv

    warning: no previously-included files matching '*' found under directory 'docs/_templates'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
Installing collected packages: virtualenv
  Running setup.py install for virtualenv
    error: could not create '/usr/local/lib/python2.7/dist-packages/virtualenv_support': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/home/samuel/build/virtualenv/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-Z2v_fR-record/install-record.txt:
    running install

running build

running build_py

running install_lib

creating /usr/local/lib/python2.7/dist-packages/virtualenv_support

error: could not create '/usr/local/lib/python2.7/dist-packages/virtualenv_support': Permission denied

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/samuel/build/virtualenv/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-Z2v_fR-record/install-record.txt failed with error code 1
Storing complete log in /home/samuel/.pip/pip.log

有没有人有我的情况的想法?

最佳答案
使用

sudo pip install virtualenv

显然,你将有权力的管理员在添加“sudo”之前行…只是不要忘记您的密码。

转载注明原文:错误:无法创建’/usr/local/lib/python2.7/dist-packages/virtualenv_support’:权限被拒绝 - 代码日志