CondaHTTPError-安装NLTK时发生SSL错误 [英] CondaHTTPError - SSL error while installing NLTK
问题描述
我正在尝试在Anaconda的Tensorflow环境中安装NLTK.我已经为Windows 7 pc使用了命令"conda install nltk".它给出了以下错误:
I am trying to install NLTK in my tensorflow environment of Anaconda. I have used the command "conda install nltk" for my windows 7 pc. It gives the following error:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
<https://repo.continuum.io/pkgs/r/win-32/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.continuum.io\', port=443): Max retries exceeded with url: /pkgs/r/win-32/repodata.json.bz2 (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')],)",),))',),)
我的系统中还有一个附加证书.因此,我将证书哈希添加到anaconda/ssl的cert.pem文件中.它适用于Linux计算机,但Windows计算机仍会引发错误.我该怎么解决?
I have an additional certificate in my system. So I added the certificate hash to cert.pem file of anaconda/ssl. It worked for Linux machine, but windows machine still throws error. What can I do to solve this?
推荐答案
您仍然可以通过从Windows计算机上的浏览器中导出CA证书来使用ssl.
You can still make use of ssl by exporting the CA Certificate from a browser on the windows machine.
将证书保存到您可以访问的文件夹中,然后只需将.condarc文件中的ssl_verify值设置为证书的位置即可.
Save the certificate to a folder that you can access, and then simply set the ssl_verify value in your .condarc file to the location of the cert.
ssl_verify: C:\\conda_config\\certificates\\ca_cert.cer
这将使您非常轻松地从ssl保护中受益.
This will allow you to benefit from ssl protection quite easily.
这篇关于CondaHTTPError-安装NLTK时发生SSL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!