这篇文章主要介绍了为什么下载python以后打不开,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获,下面让小编带着大家一起了解一下。
大家好,小编来为大家解答以下问题,为什么下载python以后打不开,python下载不了库怎么解决,今天让我们一起来看看吧!
最重要的是 确保连的WIFI不是公司的网络!!!要连自己的手机热点;
问题描述:
当在命令窗口(Win+cmd)用pip install librosa 指令 想下载第三方库的时候,一直失败;
总而言之,在原指令的后面再加上:
-i Simple Index pip --trusted-host pypi.tuna.tsinghua.edu.cn
就可以;
更新pip也是同理,指令为:
pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple pip --trusted-host pypi.tuna.tsinghua.edu.cn
报错信息:
指令:pip install librosa
C:\Users\na.chen>pip install librosa
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': /simple/librosa/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': /simple/librosa/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': /simple/librosa/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': /simple/librosa/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': /simple/librosa/
Could not fetch URL https://pypi.org/simple/librosa/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/librosa/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))) - skipping
ERROR: Could not find a version that satisfies the requirement librosa (from versions: none)
ERROR: No matching distribution found for librosa
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))) - skipping
WARNING: There was an error checking the latest version of pip.
图片截图:
![](https://i-blog.csdnimg.cn/blog_migrate/9eb59f184b92d0cd06af079ecd252759.png)
解决方法:
指令改成:
pip install librosa -i Simple Index pip --trusted-host pypi.tuna.tsinghua.edu.cn
C:\Users\na.chen>pip install librosa -i https://pypi.tuna.tsinghua.edu.cn/simple pip --trusted-host pypi.tuna.tsinghua.edu.cn
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting librosa
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e4/1c/23ef2fd02913d65d43dc7516fc829af709314a66c6f0bdc2e361fdcecc2d/librosa-0.9.2-py3-none-any.whl (214 kB)
---------------------------------------- 214.3/214.3 kB 687.1 kB/s eta 0:00:00
Requirement already satisfied: pip in c:\program files\windowsapps\pythonsoftwarefoundation.python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages (22.3.1)
Collecting packaging>=20.0
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ed/35/a31aed2993e398f6b09a790a181a7927eb14610ee8bbf02dc14d31677f1c/packaging-23.0-py3-none-any.whl (42 kB)
---------------------------------------- 42.7/42.7 kB 514.9 kB/s eta 0:00:00
Collecting numpy>=1.17.0
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/fa/df/53e8c0c8ccecf360b827a3d2b1b6060644c635c3149a9d6415a6fe4ccf44/numpy-1.24.2-cp310-cp310-win_amd64.whl (14.8 MB)
Collecting resampy>=0.2.2
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f2/d3/5209fd2132452f199b1ddf0d084f9fd5f5f910840e3b282f005b48a503e1/resampy-0.4.2-py3-none-any.whl (3.1 MB)
---------------------------------------- 3.1/3.1 MB 925.5 kB/s eta 0:00:00
Collecting scipy>=1.2.0
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ec/97/719e7c5b5081524b056652eec1e31c08a54f262f00dae62089094bde66b3/scipy-1.10.0-cp310-cp310-win_amd64.whl (42.5 MB)
---------------------------------------- 42.5/42.5 MB 88.9 kB/s eta 0:00:00
Collecting joblib>=0.14
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/91/d4/3b4c8e5a30604df4c7518c562d4bf0502f2fa29221459226e140cf846512/joblib-1.2.0-py3-none-any.whl (297 kB)
---------------------------------------- 298.0/298.0 kB 52.2 kB/s eta 0:00:00
最后成功的截图:
![](https://i-blog.csdnimg.cn/blog_migrate/250fa9d9fb3d2fadf1c5da28f061cc51.png)