报错提示:html
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
可经过如下命令升级pippython
python -m pip install --upgrade pip
若是是timeout类形错误,那重点怀疑网络问题,多是官方的PyPi太慢致使。网络
这类错误可经过在pip.ini中index-url指定为使用本地源进行处理。我这里以清华源为例,具体操做步骤看下边第二大点。编辑器
如今不少网站都换成了HTTPS,python验证证书没经过时就会拒绝使用PyPi源,一般报错以下:ide
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/gg/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsin ghua.edu.cn', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by S SLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),)) - skipping
这类错误可经过在pip.ini中添加trusted-host进行处理。我这里以信任清华源为例,具体操做步骤看下边第二大点。post
这类错误处理,一是安装vc环境不过到如今我还不是很明白要装哪一个文件,更推荐的作法是使用conda安装第三方库,具体操做参见“PyCharm+Miniconda3安装配置教程” 第二大点查看如何安装conda及参看3.2.2节看如何用conda安装第三方库fetch
一般报错以下:网站
“distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required”
“Command "python setup.py egg_info" failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-6fjrrgj5\cffi\”
%APPDATA%
路径【可选】echo %APPDATA%
我这里直接在cmd使用命令建立。图形界面创的话,上一步咱们已查到%APPDATA%
的指向了一层层根着创便可ui
mkdir %APPDATA%\pip
使用文件编辑器建立一个文本,而后输入如下内容,并将其保存到上边的%APPDATA%\pip\目录下,命名为pip.ini便可(注意不要保存成pip,ini.txt)url
Linux等是$HOME/.config/pip/pip.conf,index-url行可不须要
[global] trusted-host = pypi.tuna.tsinghua.edu.cn index-url = https://pypi.tuna.tsinghua.edu.cn/simple
我这里以pip安装faker库进行验证,本身随便装什么都行
pip install faker
参考:
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
http://mirrors.ustc.edu.cn/help/pypi.html
https://superuser.com/questions/727924/pip-and-ssl-certificate-errors