ubuntu换pip源

Ubuntu 下使用pip安装第三方库时,会遇到安装速度过慢的情况。

具体其实跟windows情况下一样。

我们需要更换pip镜像源,方法如下:

 

~$ mkdir ~/.pip

~$ sudo gedit ~/.pip/pip.conf

然后添加国内源(任选):
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

将下面的内容复制到pip.conf中,保存退出。在去试下。

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

 

 

 

操他妈的pip我更新之后没法用了

提示没有安装typing

看了starkoverflow的观点https://stackoverflow.com/questions/67344483/importerror-no-module-named-typing-when-trying-to-install-a-package

先卸载python -m pip uninstall pip

然后再sudo apt install pip

posted @ 2021-06-16 21:16  Koz_0  阅读(345)  评论(0)    收藏  举报