进入 python安装根目录的 scripts目录 打开cmd
从镜像下载依赖
pip install -i http://pypi.douban.com/simple numpy
检查更新
pip list --outdated
更新
pip install --update numpy
pip install -i http://pypi.douban.com/simple numpy
-----------------------------------------------------------------------------------------------------------
以下内容为转载
原文链接:https://blog.youkuaiyun.com/qq_15969343/article/details/79057042
-----------------------------------------------------------------------------------------------------------
使用pip来安装python包对大家来说应该是家常便饭了,但是很多时候因为pip的源都不在国内,如果没有科学上网的话,安装起来会非常慢!因此就想换成国内的源来加速下载!
目前国内的源有:
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
因此直接使用:
pip install -i http://pypi.doubanio.com/simple/ kivy.deps.gstreamer
来进行源安装,但是往往会出现如下问题:The repository located at pypi.doubanio.com is not a trusted or secure host and is being ignored.
因此这里面很多都是http的源,如果直接使用http的话就会出错,那怎么办呢?看了上面的提示将http改为https试试:
pip install -i https://pypi.doubanio.com/simple/ kivy.deps.gstreamer
注意:初次使用镜像可能需要 添加 --trusted-host <自定义host name> 否则出现 Cannot unpack file xxx 错误
pip install -i https://pypi.douban.com/simple --trusted-host duoban pandas
全局指定index
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com
pip config list
安装到指定目录
pip install transforms3d --target=/home/dell/anaconda3/lib/python3.6/site-packages
从本地文件夹安装
pip install --no-index --find-links=/local/wheels -r requirements.txt