簡體   English   中英

CondaHTTPError-安裝NLTK時發生SSL錯誤

[英]CondaHTTPError - SSL error while installing NLTK

我正在嘗試在Anaconda的Tensorflow環境中安裝NLTK。 我已經為Windows 7 pc使用了命令“ conda install nltk”。 它給出以下錯誤:

 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計算機仍會引發錯誤。 我該怎么解決?

我找到了解決方案。 我已經修改了.condarc文件,並將ssl_verify屬性設置為False。 看起來像這樣:

 channels:
   - defaults
 ssl_verify: False

現在,我可以添加打包好的文件了。

另一種方法是從命令行修改配置文件:

conda config --set ssl_verify False

它將為您編輯文件,無論它位於何處。

您仍然可以通過從Windows計算機上的瀏覽器導出CA證書來使用ssl。

http://docs.bvstools.com/home/ssl-documentation/exporting-certificate-authorities-cas-from-a-website

將證書保存到您可以訪問的文件夾中,然后只需將.condarc文件中的ssl_verify值設置為證書的位置。

ssl_verify: C:\\conda_config\\certificates\\ca_cert.cer

這將使您很容易受益於ssl保護。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM