1

I am trying to install pytorch on ubuntu 14.04, and i am using python 2.7.6/ cuda 8.0. But error comes out.

error 1:

torch-1.0.0-cp27-cp27m-linux_x86_64.whl is not a supported wheel on this platform.

error 2:

  InsecurePlatformWarning
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'),)': /whl/cu80/torch-1.0.0-cp27-cp27mu-linux_x86_64.whl
/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='download.pytorch.org', port=443): Max retries exceeded with url: /whl/cu80/torch-1.0.0-cp27-cp27mu-linux_x86_64.whl (Caused by SSLError(SSLError(1, '_ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'),))

I found that Insecureplatformwarning always appeared whenever i tried to install new modules. Is it possible to solve this problem without changing version of python or cuda? Since i am using tensorflow1.3.0 for python 2.7 and cuda 8.0, I am reluctant to change the version of python or cuda.

Armali
  • 18,255
  • 14
  • 57
  • 171
Hee.Kim
  • 41
  • 3

1 Answers1

0

The first issue of the unsupported pytorch wheel is addressed in detail in the related posting specific to your case. Please try torch-1.0.1.post2-cp27-cp27mu-manylinux1_x86_64.whl (582.5 MB) downloadable via web browser from the Python Package Index website.

About the SSLError...sslv3 alert handshake failure, the error suggests that your operating system's OpenSSL library version<1.0.1 and Python version<2.7.9 do not support the newer TLS protocol version 1.2 that pip requires to connect to PyPI since about a year ago.
You can check the system OpenSSL library version with:
$ python -c "import ssl; print(ssl.OPENSSL_VERSION)" && openssl version

Even if the openssl library was up-to-date, another problem is that Python version 2.7.6 itself has ssl module that doesn't support PROTOCOL_TLSv1_2, which needs Python versions 2.7.9+ (or 3.4+) or later. In Ubuntu, the Python 2.7.9 version first appeared in Vivid Vervet (15.04) and Python 3.4 - since 14.10 (Utopic Unicorn), while current 18.04 LTS (Bionic Beaver) ships 2.7.14+ and 3.6.4+ respectively.

" > Is it possible to solve this problem without changing version of python or cuda? "

Fortunately, yes, to fix it you can install several Python wheels (packages) manually -- the detailed step-by-step guide is available here on Stackoverflow.

Specifically, the cryptography manylinux1 wheel contains the most recent statically-linked OpenSSL library that will re-enable pip (versions 10+) and will allow you to continue to use your good old Ubuntu linux with new Python programs.