google、aws 这些云服务厂商有提供 pypi 的 镜像源吗?
国内有很多镜像源地址,比如清华 pypi 镜像源地址:https://pypi.tuna.tsinghua.edu.cn/simple
那么,google、aws 这些云服务厂商有提供 pypi 的 镜像源吗?有的话,地址是啥?
让 chatGPT 给了我两个,都是无法使用的
pip install lxml -i https://pypi.awsbjx.com/simple/pip install lxml -i https://pypi.googlemirrors.cn/simple/
root@publisher-directed-crawling-server-gcp-prod-5bc74b8c99-hstn2:/code# pip install lxml -i https://pypi.awsbjx.com/simple/Looking in indexes: https://pypi.awsbjx.com/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f0c1e4abb20>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f0c1e4abe50>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f0c1e4abf10>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
^CERROR: Operation cancelled by user
^C
root@publisher-directed-crawling-server-gcp-prod-5bc74b8c99-hstn2:/code# ^C
root@publisher-directed-crawling-server-gcp-prod-5bc74b8c99-hstn2:/code# ^C
root@publisher-directed-crawling-server-gcp-prod-5bc74b8c99-hstn2:/code# ^C
root@publisher-directed-crawling-server-gcp-prod-5bc74b8c99-hstn2:/code# ^C
root@publisher-directed-crawling-server-gcp-prod-5bc74b8c99-hstn2:/code# pip install lxml -i https://pypi.googlemirrors.cn/simple/
Looking in indexes: https://pypi.googlemirrors.cn/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3fae29bb20>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3fae29be50>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3fae29bf10>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3fae2d83a0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3fae2d8550>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/lxml/
ERROR: Could not find a version that satisfies the requirement lxml (from versions: none)
ERROR: No matching distribution found for lxml
回答:
AWS应该没有公共镜像,只有私有镜像: https://docs.aws.amazon.com/codeartifact/latest/ug/python-con...
回答:
在安装python package时候链接的https://pypi.org 是国外的网站,速度相对比较慢。可以直接链接国内的镜像网站来安装,是常以下的一些国内镜像资源:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
使用方法
- pip 直接 -i 加 url 即可!如下:
pip install web.py -i http://pypi.douban.com/simple #如果报错: 使用命令—— pip install web.py -i http://pypi.douban.com/simple --trusted-host pypi.douban.com - 配置编译器, pycharm 为例
打开File》》setting》》Project:PythonProject, click Python Interpreter
Click "+" to open available package dialog, click Manage Repositories, change https://pypi.python.org/simple to 镜像站点
然后通过, 点选available package找到要安装的package来安装
以上是 google、aws 这些云服务厂商有提供 pypi 的 镜像源吗? 的全部内容, 来源链接: utcz.com/p/938887.html