本文介绍了使用pip install安装tensorflow-gpu时发生SSL错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在miniconda内使用pip install tensorflow-gpu安装tensorflow-gpu(不在环境中),并且出现此错误:

I am trying to install tensorflow-gpu using pip install tensorflow-gpu inside miniconda(not in an environment), and I am getting this error:

`Could not install packages due to an EnvironmentError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1977)

`这是什么意思?我如何解决它?我也以管理员身份安装它,没有管理员就尝试了,同样的结果.

`What does it mean? How do I fix it? I am also installing it as admin, tried it without admin, same result.

`C:\WINDOWS\system32>pip install tensorflow-gpu
Collecting tensorflow-gpu
  Downloading https://files.pythonhosted.org/packages/2f/84/b6dfafe3282101f7d3a9410652ab4e6dc73f981fd63a40be0b47ff3bac3a/tensorflow_gpu-1.9.0-cp35-cp35m-win_amd64.whl (103.3MB)
    19% |######                          | 19.9MB 2.6MB/s eta 0:00:32Could not install packages due to an EnvironmentError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1977)`

这是我的计算机规格:

英特尔i7 8700k

Intel i7 8700k

华硕Z370 Mobo

Asus Z370 Mobo

华硕GTX 1080 Ti Turbo

Asus GTX 1080 Ti Turbo

而且,这是我第一次遇到这个问题.

Also, this is the first time I have come across this problem.

我只是尝试再次安装它,所以它起作用了!不过,仍然想找出导致此问题的原因.

I just tried installing it again, and it worked! Still want to find out what caused this problem, though.

更新:如果您没有看到注释,则是由于OpenSSL安装出现某些错误.但是最后,我只是清理了python并重新安装了miniconda.

Update: If you didn't see the comments, this was due to some error with the OpenSSL installation. In the end, however, I just ended up cleaning python and freshly reinstalling miniconda.

推荐答案

发生这种情况的原因是因为我试图通过在外部安装库来修改python安装(即,将文件复制到python安装中).当我改变主意并决定不安装该文件时,我删除了这些文件,但是我肯定已经在其中留下了一些文件.这可能是破坏我的python安装并导致这些影响的原因.故事的寓意:如果什么都没用,请重新安装所有内容……也不要与python混淆(提示:它是蛇)

The reason this happened is because I tried to modify my python installation by installing a library externally(i.e. copying files into the python installation). When I changed my mind and decided to not install that thing, I deleted the files, but I must have left some still lying around in there. This is probably what broke my python installation, and lead to these effects. Moral of the story: if nothing works, reinstall everything... also don't mess with python(hint: its a snake)

这篇关于使用pip install安装tensorflow-gpu时发生SSL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 10:24