最新消息:20210917 已从crifan.com换到crifan.org

【已解决】macOS中全局设置pip源是ustc但是当前项目却从tsinghua的源去安装

设置 crifan 487浏览 0评论
折腾:
【未解决】Win中VMWare中macOS初始化项目代码调试环境
期间,注意到:
✘ crifanli@crifanlideMac  ~/dev/DevRoot/appcrawler   master  pip install virtualenv             
Looking in indexes: http://pypi.mirrors.ustc.edu.cn/simple/
Collecting virtualenv
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f0/55/f0de23cb61f2e90db3f8362f0e685a0bc04d0c4cb159b7a96cb7c4817d63/virtualenv-20.0.23-py2.py3-none-any.whl (4.7MB)
     |████████████████████████████████| 4.7MB 2.9MB/s
Collecting appdirs<2,>=1.4.3 (from virtualenv)
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whl
Collecting filelock<4,>=3.0.0 (from virtualenv)
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/93/83/71a2ee6158bb9f39a90c0dea1637f81d5eef866e188e1971a1b1ab01a35a/filelock-3.0.12-py3-none-any.whl
Collecting distlib<1,>=0.3.0 (from virtualenv)
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/7d/29/694a3a4d7c0e1aef76092e9167fbe372e0f7da055f5dcf4e1313ec21d96a/distlib-0.3.0.zip (571kB)
     |████████████████████████████████| 573kB 27.6MB/s
Collecting six<2,>=1.9.0 (from virtualenv)
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Installing collected packages: appdirs, filelock, distlib, six, virtualenv
  Running setup.py install for distlib ... done
Successfully installed appdirs-1.4.4 distlib-0.3.0 filelock-3.0.12 six-1.15.0 virtualenv-20.0.23
WARNING: You are using pip version 19.2.3, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
发现此处pip是清华的源,貌似没中科大的快,所以去换成中科大的
不过发现找不到此处的清华的源的设置的地方了。
此处全局的pip是ustc的啊:
crifanli@crifanlideMac  ~/dev/DevRoot/appcrawler   master  cat ~/.pip/pip.conf
[global]
index-url = http://pypi.mirrors.ustc.edu.cn/simple/
[install]
trusted-host=pypi.mirrors.ustc.edu.cn
怀疑是当前文件夹下面,有隐藏文件,加的整个设置。
所以去macOS中找找如何显示隐藏文件和文件夹
【已解决】macOS中如何让Finder显示隐藏文件和文件夹
再去看看哪里设置了清华的源
还是没找到。
暂时不去研究了。
等真的觉得清华的pip源速度慢,再去想办法换ustc的。
后续遇到
【已解决】macOS中pip恢复安装库报错:ERROR Could not find a version that satisfies the requirement pbr from versions none
为了避免源的影响,回来继续。
【总结】
此处,全局设置了pip的源是ustc中科大的,结果却发生:
查找库是从ustc的:
Looking in indexes: http://pypi.mirrors.ustc.edu.cn/simple/
但是真正下载确变成了清华的:
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f0/55/f0de23cb61f2e90db3f8362f0e685a0bc04d0c4cb159b7a96cb7c4817d63/virtualenv-20.0.23-py2.py3-none-any.whl (4.7MB)
原因:
ustc的pypi源(由于某些原因,可能是网络资源和流量太大,成本太高)而不维护了,内部直接切换到了清华的源了
解决办法:
把pip的源,彻底换成清华的源:
✘ crifanli@crifanlideMac  ~  cat ~/.pip/pip.conf
[global]
#index-url = http://pypi.mirrors.ustc.edu.cn/simple/
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
#trusted-host=pypi.mirrors.ustc.edu.cn
trusted-host=pypi.tuna.tsinghua.edu.cn
即可
详见:
【已解决】macOS中pip恢复安装库报错:ERROR Could not find a version that satisfies the requirement pbr from versions none

转载请注明:在路上 » 【已解决】macOS中全局设置pip源是ustc但是当前项目却从tsinghua的源去安装

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.180 seconds, using 23.38MB memory