[英]pip install: upgrade a library in /usr without sudo
python-six
is installed in /usr
and I need to upgrade it, but I don't have root privileges. python-six
安装在/usr
我需要升级它,但我没有root权限。
I know how to install a library without root privileges: 我知道如何安装没有root权限的库:
pip install --install-option="--prefix=$HOME/.local" six
I know how to upgrade a library with root privileges: 我知道如何使用root权限升级库:
pip install --upgrade six
But when I try to upgrade the library as so: 但是当我尝试升级库时:
pip install --upgrade --install-option="--prefix=$HOME/.local" six
I get: 我明白了:
Downloading/unpacking six from https://pypi.python.org/packages/source/s/six/six-1.7.3.tar.gz#md5=784c6e5541c3c4952de9c0a966a0a80b
Running setup.py egg_info for package six
no previously-included directories found matching 'documentation/_build'
Installing collected packages: six
Found existing installation: six 1.2.0
Uninstalling six:
Exception:
OSError: [Errno 13] Permission denied: '/usr/share/pyshared/six-1.2.0.egg-info'
So, how can I upgrade six
without sudo? 那么,如何在没有sudo的情况下升级six
?
For this - I would recommend working inside a virtual environment: 为此 - 我建议在虚拟环境中工作:
http://docs.python-guide.org/en/latest/dev/virtualenvs/ http://docs.python-guide.org/en/latest/dev/virtualenvs/
Then you will have total control of your Modules without bugging the SysAdmin for sudo 然后,您将完全控制您的模块,而不会为SysAdmin添加sudo
HTH's Thanks //P HTH的谢谢// P.
Disclaimer - involves more pip work ;-) 免责声明 - 涉及更多点子工作;-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.