阿里云服务器(centos 7)中配置pip阿里源

2020-08-30  本文已影响0人  mutang

阿里云服务器(centos 7)中配置pip阿里源

​ 我购买的esc云服务器中,自带python3.6环境,当我 打开

注意:链接不正确。

cat ~/.pip/pip.conf

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
###
[global]
index-url=http://mirrors.cloud.aliyuncs.com/pypi/simple/

[install]
trusted-host=mirrors.cloud.aliyuncs.com

我以为,已经配置好了阿里云镜像。当我执行,pip3 install selenium时,才发现下载链接不对,还是python自带的链接,速度超慢。经查询,才发现链接不对。

正确链接:

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

[install]
trusted-host=mirrors.aliyun.com

当替换之后,再次执行:

pip3 install selenium

WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting selenium
  Downloading http://mirrors.aliyun.com/pypi/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl (904kB)
    100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 911kB 50.1MB/s 
Requirement already satisfied: urllib3 in /usr/local/lib/python3.6/site-packages (from selenium)
Installing collected packages: selenium
Successfully installed selenium-3.141.0

哈哈,速度50M/S,开森。

总结:

  1. 警告:不要在root用户下,安装

    我不管,因为当我使用

    pip3 install selenium --user

    还是不行

  2. 为什么阿里云esc自带不能下载的链接?我很疑惑,路过的有谁知道,麻烦告知一声。

上一篇下一篇

猜你喜欢

热点阅读