ttdpjs 发表于 2022-12-6 19:48:52

request模块下载问题

PS C:\Users\pengjiashun\PycharmProjects\pythonProject> pip install requests
Collecting requests
Using cached requests-2.28.1-py3-none-any.whl (62 kB)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/idna/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/idna/
Collecting idna<4,>=2.5
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTime
outError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002A120463850>, 'Connection to files.pythonhosted.org tim
ed out. (connect timeout=15)')': /packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTime
outError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002A120462050>, 'Connection to files.pythonhosted.org tim
ed out. (connect timeout=15)')': /packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolErr
or('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))': /packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeout
Error("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTime
outError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002A120461A20>, 'Connection to files.pythonhosted.org tim
ed out. (connect timeout=15)')': /packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries ex
ceeded with url: /packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (Caused by ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)"))

WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the 'C:\Users\pengjiashun\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
PS C:\Users\pengjiashun\PycharmProjects\pythonProject>
PS C:\Users\pengjiashun\PycharmProjects\pythonProject>
PS C:\Users\pengjiashun\PycharmProjects\pythonProject>
PS C:\Users\pengjiashun\PycharmProjects\pythonProject> edwfsaefs
edwfsaefs : 无法将“edwfsaefs”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确
,然后再试一次。
所在位置 行:1 字符: 1
+ edwfsaefs
+ ~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (edwfsaefs:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\pengjiashun\PycharmProjects\pythonProject>


——————————————————————————————————————————————————————————————————————————————————————————————————
这是啥情况啊?家人们!!!!
我用settings|(pycharm)也安装了,安装不了!!!
求助!!!!!

jackz007 发表于 2022-12-6 20:51:47

本帖最后由 jackz007 于 2022-12-6 20:57 编辑

      先执行这两条命令,把 pip 的镜像源设置为阿里云
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/         
pip config set install.trusted-host mirrors.aliyun.com
      然后再安装,以后所有的安装源都会使用阿里云
      当然,也可以通过下面这条命令,把安装源设置为清华大学:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
      安装源换到国内以后,就再也不会出现 timeout 之类的问题。

lymww 发表于 2022-12-6 21:25:29

本帖最后由 lymww 于 2022-12-6 21:27 编辑

你这好像是连接超时,你在后面加个源就行了

我这用的科技学校的源

pip install requests -i 源地址

源地址是一个网址,发不出来,你自己可以搜一下pip源就出来了

pip install requests -i http哈哈://pypi.mirrors.ustc.edu.cn/simple/

你把其中的哈哈去掉就可以了,不然真发不出来{:10_266:}

其实你以后用pip安装东西都可以加上源,访问快一下


ttdpjs 发表于 2022-12-7 17:04:29

lymww 发表于 2022-12-6 21:25
你这好像是连接超时,你在后面加个源就行了

我这用的科技学校的源


okok,我去试试

ttdpjs 发表于 2022-12-7 17:07:48

lymww 发表于 2022-12-6 21:25
你这好像是连接超时,你在后面加个源就行了

我这用的科技学校的源


不行呀,宝贝
C:\Users\pengjiashun>pip install requests -i http://pypi.mirrors.ustc.edu.cn/simple/
WARNING: The index url "http://pypi.mirrors.ustc.edu.cn/simple/" seems invalid, please provide a scheme.
Looking in indexes: http://pypi.mirrors.ustc.edu.cn/simple/
WARNING: Location 'http://pypi.mirrors.ustc.edu.cn/simple/requests/' is ignored: it is either a non-existing path or lacks a specific scheme.
ERROR: Could not find a version that satisfies the requirement requests (from versions: none)
ERROR: No matching distribution found for requests
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the 'C:\Users\pengjiashun\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip'

ttdpjs 发表于 2022-12-7 17:10:32

lymww 发表于 2022-12-6 21:25
你这好像是连接超时,你在后面加个源就行了

我这用的科技学校的源


好了,我去换了个清华的源地址,现在好了
谢谢!!!

lymww 发表于 2022-12-8 10:26:20

ttdpjs 发表于 2022-12-7 17:10
好了,我去换了个清华的源地址,现在好了
谢谢!!!

嗯嗯好了就行

有时候有些源可以,有些源不行,你轮换着来,总有适合的{:10_279:}

Chinese-淼 发表于 2022-12-8 10:59:37

lymww 发表于 2022-12-6 21:25
你这好像是连接超时,你在后面加个源就行了

我这用的科技学校的源


{:7_130:}
页: [1]
查看完整版本: request模块下载问题