pip错误

pip安装第三方库报错Could not fetch URL https://pypi.org/simple/pip/:

There was a problem confirming the ssl certificate windows环境用pip安装第三方库Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retrie s exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: UNKNOWN _PROTOCOL] unknown protocol (_ssl.c:852)'),)) - skipping

应该是 https://pypi.org/simple/pip/ 这个地址,被拦截了

通过百度解决办法:

pip install package_name -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
可替换用的镜像源

1)http://mirrors.aliyun.com/pypi/simple/ 阿里云
2)https://pypi.mirrors.ustc.edu.cn/simple/ 中国科技大学
3)http://pypi.douban.com/simple/ 豆瓣
4)https://pypi.tuna.tsinghua.edu.cn/simple/ 清华大学
5)http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学

error: subprocess-exited-with-error

执行安装python依赖包的时候,

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 24: invalid continuation byte

应该与linux 系统编码‘uft-8’有关

[root@localhost ~]# locale
LANG=zh_CN.GBK
LC_CTYPE="zh_CN.GBK"
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
LC_ALL=zh_CN.GBK
cat >>  /etc/profile << EOF
LANG=zh_CN.UTF-8
LC_ALL=en_US.UTF-8
EOF

source .bash_profile

如果settings中配置了MEDIA_ROOT则会在MEDIA_ROOT下创建uploads,否在会在根目录下创建uploads

Last updated