Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL error while using pip install to install tensorflow-gpu

Tags:

pip

ssl

I am trying to install tensorflow-gpu by running pip install tensorflow-gpu Windows, inside an Anaconda enviornment, but I am getting the following 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)

I also tried doing it in a command prompt with administrator access, but it still didn't work.

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:32
Could not install packages due to an EnvironmentError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1977)

All other network-related activities(such as browsing the web) work properly on the computer. I also have the correct CUDA and cuDNN installed, along with the latest NVIDIA drivers.

I fixed this problem by purging my Anaconda installation and reinstalling it, and then installing tensorflow-gpu. However, I am still curious as to why this error even happened in the first place.

like image 963
Sagar Patil Avatar asked Jul 19 '18 16:07

Sagar Patil


People also ask

Can I install TensorFlow using pip?

TensorFlow requires a recent version of pip, so upgrade your pip installation to be sure you're running the latest version. Then, install TensorFlow with pip. Note: Do not install TensorFlow with conda. It may not have the latest stable version.

Why is TensorFlow not installing?

tensorflow only supports python 64-bit. You might be using 32-bit installation. Install 64-bit python and it works with pip install tensorflow directly.

Does Python 3.7 support TensorFlow?

TensorFlow is tested and supported on the following 64-bit systems: Python 3.7–3.10.

Does Python 3.8 support TensorFlow GPU?

Tensorflow does not support Python 3.8 at the moment. The latest supported Python version is 3.7. A solution is to install Python 3.7, this will not affect your codes since Python 3.7 and 3.8 are very similar.


2 Answers

It's related to network connection. I faced the same error in my Ubuntu system. Hence solved it by changing my network(WiFi) connection.

like image 197
CuriousHash Avatar answered Sep 17 '22 16:09

CuriousHash


Use the following syntax while installation packages:

pip install --user packagename
like image 31
Devendra Kanade Avatar answered Sep 20 '22 16:09

Devendra Kanade