linux 中 给pip配置源
001、
[root@PC1 ~]# pip config list
002、
[root@PC1 ~]# cd ~ [root@PC1 ~]# ls -a . .bash_history .bashrc .cshrc Documents .ICEauthority Music Public .tcshrc .viminfo .. .bash_logout .cache .dbus Downloads initial-setup-ks.cfg Pictures .python_history Templates anaconda-ks.cfg .bash_profile .config Desktop .esd_auth .local .pki .ssh Videos [root@PC1 ~]# mkdir .pip [root@PC1 ~]# ls -a . .bash_history .bashrc .cshrc Documents .ICEauthority Music .pki .ssh Videos .. .bash_logout .cache .dbus Downloads initial-setup-ks.cfg Pictures Public .tcshrc .viminfo anaconda-ks.cfg .bash_profile .config Desktop .esd_auth .local .pip .python_history Templates [root@PC1 ~]# cd .pip/ [root@PC1 .pip]# ls
003、
备用源:
- 豆瓣 https://pypi.douban.com/simple/
- 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
- 中科大 https://pypi.mirrors.ustc.edu.cn/simple/
- 阿里云 https://mirrors.aliyun.com/pypi/simple/
[root@PC1 .pip]# vim pip.conf ## 增加如下内容,保存退出 [global] index-url = https://pypi.mirrors.ustc.edu.cn/simple/ ## 可以更换 [install] trusted-host = https://pypi.mirrors.ustc.edu.cn/
004、
[root@PC1 .pip]# pip config list global.index-url='https://pypi.mirrors.ustc.edu.cn/simple/' install.trusted-host='https://pypi.mirrors.ustc.edu.cn/'
005、安装测试
[root@PC1 .pip]# pip install pandas
005、列出第三方库
[root@PC1 .pip]# pip list
006、临时指定源
[root@PC1 .pip]# pip install flask -i https://mirrors.aliyun.com/pypi/simple
参考:
001、https://zhuanlan.zhihu.com/p/349015182?utm_id=0
002、https://blog.csdn.net/weixin_42873928/article/details/105437729
003、https://blog.csdn.net/weixin_43632687/article/details/104646607
分类:
python
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2022-05-16 linux 中正则表达式同时匹配字母和数字
2022-05-16 正则表达式中常见特殊字符的意义
2022-05-16 正则表达式中 + 的作用
2022-05-16 正则表达式中?和*的区别
2022-05-16 正则表达式中.* 和 .*?的区别
2022-05-16 正则表达式中.和*的区别
2022-05-16 linux 中 sed预存储命令