1.pip

1.临时使用:(这里以opencv-python joblib包为例,并使用清华镜像源,并且后面的地址就是清华镜像源地址)

pip install opencv-python joblib -i https://pypi.tuna.tsinghua.edu.cn/simple 

2.永久配置:

输入以下代码即可

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

2.conda

您可以先通过以下代码查看您的镜像源:

conda config --show channels

接下来运行以下代码即可添加清华镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2


                            

此外,您如果想删除添加源,恢复默认源,运行以下代码即可

conda config --remove-key channels

3.其他镜像源

清华大学开源软件镜像站:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云开源镜像站:https://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

如果您觉得文章还不错,请大家点赞、分享、留言下,因为这将是我持续输出更多优质文章的最强动力!

Logo

火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。

更多推荐