快速安装python库
国内镜像有:
清华: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.douban.com/simple/
命令:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 库名
可以设置timeout避免超时
pip install --default-timeout=1000 库名 -i https://pypi.tuna.tsinghua.edu.cn/simple
指定python版本的pip安装库
当安装了多个python版本时,如果直接使用python的话,会安装到系统默认的路径下,如果需要指定一个python解释器,需要命令:路径\python -m pip install 库名
。
安装新包时,遇到卸载原有库报错
报错信息:Cannot uninstall 'xxx'. It is a distutils installed project and thus we cannot accurately
直接安装新的包,忽略原有的版本即可,使用–user参数:pip install --user moviepy --ignore-installed