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

 

posted @   小鲨鱼2018  阅读(820)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!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预存储命令
点击右上角即可分享
微信分享提示