当前位置:   article > 正文

pip install换源

pip install换源

pypi换源总结

由于pypi源默认为国外源,经常被墙导致不可用,所以安装软件时pip源最好更换为国内资源

常用国内源:

豆瓣:https://pypi.douban.com/simple/
清华:https://pypi.tuna.tsinghua.edu.cn/simple

使用方法

直接使用:
在安装软件时使用带源地址的安装方法,以安装keras为例输入如下命令:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple keras

更换python安装目录下的源地址:将…\Lib\site-packages\pip\models\index.py文件中的PyPI值修改为你希望的国源链接。如将其修改为清华源:

注释掉:PyPI = Index(‘https://pypi.python.org/’)
修改源:PyPI = Index(‘https://pypi.tuna.tsinghua.edu.cn/simple’)

修改后安装keras命令:pip install keras

Anaconda 清华镜像使用

参考: https://mirrors.tuna.tsinghua.edu.cn/help/anaconda
运行以下命令:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
  • 1
  • 2
  • 3

Python2 to Python3

python安装路径下,已有转换执行程序2to3.exe
转换命令

2to3 --output-dir=python3-version -W -n python2-version
  • 1

pip install 未安装到虚拟环境中

activate envs
python -m pip install onnxruntime-gpu==1.16.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 1
  • 2

Git 仓库拉取第三方库编译源码

git clone --depth 1 --branch dev-1.x --recursive https://github.com/open-mmlab/mmdeploy.git
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/523577
推荐阅读
相关标签
  

闽ICP备14008679号