1

Salutations!

I am getting an error when attempting to install TensorFlow in a Python virtualenv. I created a Python 3.7 virtual environment for a data project that I'm working on. I tried installing TensorFlow into that environment and I received the following error:

ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/34/d5/ce8c17971067c0184c9045112b755be5461d5ce5253ef65a367e1298d7c5/tensorflow-2.1.0-cp37-cp37m-win_amd64.whl (Caused by ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)))

I'm guessing this may be due to me being on a work network, which may have firewall restrictions, but I am not totally sure.

Any insight would be greatly appreciated.

Gratitude!

  • What are the commands that you've used to install it ? – Niloct Apr 17 '20 at 00:39
  • To see if there is a firewall issue, `telnet files.pythonhosted.org 443`. – Niloct Apr 17 '20 at 00:39
  • @Niloct after I activated the venv, I used the pip install tensorflow command. – jalilel1913 Apr 17 '20 at 00:48
  • @Niloct I ran the telnet command and command prompt went to a blank screen with the cursor flashing, so I guessing I can connect? – jalilel1913 Apr 17 '20 at 01:15
  • You're right, but a proxy may be active. See this: https://github.com/pypa/pip/issues/5309#issuecomment-383440367 – Niloct Apr 17 '20 at 02:25
  • I see. I'll try running the pip install tensorflow command later from my home network. Gratitude for your assistance! @Niloct – jalilel1913 Apr 17 '20 at 02:53
  • @jalilel1913, Can you please confirm if you are able to install `Tensorflow` by executing the command, `sudo pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --upgrade --proxy=127.0.0.1:3128 robotframework` mentioned in the link, https://github.com/pypa/pip/issues/5309#issuecomment-383440367, provided by @Niloct so that we can specify it as an Answer for the benefit of the Community. Thanks! –  May 06 '20 at 07:49
  • @TensorflowWarriors I'm attempting to install in on Win 10. The commands above are for Linux. Please advise. – jalilel1913 May 07 '20 at 04:18

1 Answers1

0

You can try either the command,

pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --upgrade tensorflow

or the Command,

pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --upgrade --proxy=127.0.0.1:3128 tensorflow

For more information, please refer this Github Issue and this Stack Overflow Issue.

Hope this helps. Happy Learning for Tensorflow.