简体   繁体   English

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

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

I am using ubuntu 12.04 and I am trying to pip install virtualenv but suddenly I got this error. 我正在使用ubuntu 12.04而我正在尝试使用安装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

Does anyone have an idea about my case? 有没有人对我的案子有所了解?

I've heard that using sudo with pip is unsafe. 我听说使用带有pip sudo是不安全的。

Try adding --user to the end of your command, as mentioned here . 尝试添加--user到命令的结尾,提到这里

pip install packageName --user

I suspect that installing with this method means the packages are not available to other users. 我怀疑使用此方法安装意味着其他用户无法使用这些包。

您没有Python文件夹的权限。

sudo chown -R $USER /usr/local/lib/python2.7

Use 使用

sudo pip install virtualenv

Apparently you will have powers of administrator when adding "sudo" before the line... just don't forget your password. 显然,在行之前添加“sudo”时,您将具有管理员权限...只是不要忘记您的密码。

use 使用

sudo pip install virtualenv

You have a permission denied error. 您有权限被拒绝错误。 This states your current user does not have the root permissions.So run the command as a super user. 这表明您当前的用户没有root权限。因此,以超级用户身份运行该命令。

In the case of permission denied error, you just need to go with this command. 在权限被拒绝错误的情况下,您只需要使用此命令。

sudo pip install virtualenv

sudo before the command will throw away the current user permissions error. 命令之前的sudo将丢弃当前用户权限错误。

Note: For security risks, You should read piotr comment. 注意:对于安全风险,您应该阅读piotr评论。

pip没有给予权限所以不能做pip install.Try下面的命令。

apt-get install python-virtualenv

It's because the virtual environment viarable has not been installed. 这是因为尚未安装虚拟环境。

Try this: 试试这个:

sudo pip install virtualenv
virtualenv --python python3 env
source env/bin/activate
pip install <Package>

or 要么

sudo pip3 install virtualenv
virtualenv --python python3 env
source env/bin/activate
pip3 install <Package>

First, sudo pip install 'package-name' means nothing it will return 首先, sudo pip install 'package-name'意味着什么都不会返回

sudo: pip: command not found

You get the Permission denied, you shouldn't use pip install as root anyway. 你得到权限被拒绝,你不应该以root身份使用pip install。 You can just install the packages into your own user like mentionned above with 您可以将软件包安装到您自己的用户中,如上所述

pip install 'package-name' --user

and it will work as you intend. 它会像你想要的那样工作。 If you need it in any other user just run the same command and you'll be good to go. 如果您在任何其他用户中需要它,只需运行相同的命令,您就可以开始了。

你必须改变上述路径的权限。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IOError:[Errno 13]权限被拒绝:&#39;/usr/local/lib/python2.7/dist-packages/finsymbols/SP500.html&#39; - IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/finsymbols/SP500.html' virtualenv中的python3仍使用/usr/lib/python2.7/dist-packages中的库 - python3 in a virtualenv still uses library in /usr/lib/python2.7/dist-packages 如何在appengine app中使用/usr/local/lib/python2.7/dist-packages中的模块 - How to use module from /usr/local/lib/python2.7/dist-packages in appengine app virtualenv:无法创建“ /lib/python2.7”:权限被拒绝 - virtualenv: could not create '/lib/python2.7': Permission denied 它显示“[Errno 13]权限被拒绝:&#39;/ usr / lib / python2.7 / did-packages / Jinja2-2.8.egg-info / entry_points.txt&#39;”当试图安装烧瓶时? - It shows “ [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/Jinja2-2.8.egg-info/entry_points.txt'” when trying to install flask? OSError:[Errno 2]没有这样的文件或目录:&#39;/usr/local/lib/python2.7/dist-packages/pyduino-0.0.0-py2.7.egg&#39; - OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/pyduino-0.0.0-py2.7.egg' 如何从/usr/lib/python2.7/dist-packages/中的dir获取源软件包 - How to get source packages from dir in /usr/lib/python2.7/dist-packages/ 安装djangorestframework时出现错误-权限被拒绝:&#39;/ usr / lib / python2.7 / site-packages / djangorestframework-3.6.3.dist-info&#39; - Getting Error while installing djangorestframework - Permission denied: '/usr/lib/python2.7/site-packages/djangorestframework-3.6.3.dist-info' PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.8/dist-packages/grpc/__init__.py' - PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.8/dist-packages/grpc/__init__.py' pip将2.7个软件包安装到/usr/local/lib/python3.2/dist-packages中 - pip installs 2.7 packages into /usr/local/lib/python3.2/dist-packages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM