pip,python,ubuntu,linux,..sudo 导致失败问题(sudo -H)
2017-04-27 16:36
686 查看
安装requests库,
之前使用 pip install requests
结果没有sudo,导致失败
后面加了 sudo pip install requests
sudo pip install requests
的报错信息
才知道要加上 -H
sudo -H pip install requests
这样就好了
-H, –set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user’s
password database entry. Depending on the policy, this may
be the default behavior.
-H 将环境变数中的 HOME (家目录)指定为要变更身份的使用者家目录(如不加 -u 参数就是系统管理者 root )
之前使用 pip install requests
结果没有sudo,导致失败
后面加了 sudo pip install requests
却提示失败,无法collect……(好坑)
The directory ‘/home/bzy/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.python.org’, port=443): Read timed out. (read timeout=15)”,)’: /simple/requests/
最后仔细看了下sudo pip install requests
的报错信息
才知道要加上 -H
sudo -H pip install requests
这样就好了
-H, –set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user’s
password database entry. Depending on the policy, this may
be the default behavior.
-H 将环境变数中的 HOME (家目录)指定为要变更身份的使用者家目录(如不加 -u 参数就是系统管理者 root )
相关文章推荐
- Linux、ubuntu下pip安装aiohttp失败,修改python默认版本
- ubuntu 源更新失败问题(sudo apt-get update)
- vlc在ubuntu15.04下安装成功(解决sudo apt-get build-dep vlc失败问题)
- Linux系统之路——python多版本共存问题(ps:自行切换python版本,pip安装遇到的一些问题)
- Linux遇到的问题(一)Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
- Linux-Ubuntu16.04下Python3.5安装pip3以及scrapy、numpy、itchat
- linux切换用户,ubuntu使用root权限shell,解决 sudo cd问题
- sudo apt-get install python-pip 失败
- 解决Python下pip install MySQL-python失败的问题
- Linux添加普通用户并添加sudo权限、修改文件所属者、解决(ubuntu)只有$问题
- 解决关于python3.4 在windows安装Pillow、lxml 和 ubuntu lxml 安装失败问题
- Linux的文件描述符个数限制导致创建文件(或socket)失败的问题
- linux(ubuntu)sudoers权限错误导致sudo无法使用
- mac更改pip源,没有.pip(即linux ubuntu python pip 换源方法教程)
- 安装pip 分类: ubuntu python基础学习 python Module software 问题总结 2014-02-19 09:16 229人阅读 评论(0) 收藏
- Python-pip 安装失败问题解决
- 记录解决Python下pip install MySQL-python失败的问题
- debian-Python-pip安装失败问题解决
- DI v6.2,DI Governor在Linux下启动脚本startDIGovernor.sh编码格式问题导致启动失败
- Linux 下 pip 升级遇到的问题 python3.5 和安装 python pip