Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
installing pip
#1
I have a computer with python 3.7 and pip working.
Today I installed python 2.7 and it runs.
Now I'm trying to install pip for python 2.7 and I Always get an error message.
It tells me to upgrade to a newer version but I want to use version 2.7.
Anybody any idea what the problem is?
C:\>cd python27

C:\Python27>python2 get-pip.py
Collecting pip
c:\users\brecht\appdata\local\temp\tmpnik5f4\pip.zip\pip\_vendor\urllib3\util\ss
l_.py:369: SNIMissingWarning: An HTTPS request has been made, but the SNI (Serve
r Name Indication) extension to TLS is not available on this platform. This may
cause the server to present an incorrect TLS certificate, which can cause valida
tion failures. You can upgrade to a newer version of Python to solve this. For m
ore information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.htm
l#ssl-warnings
c:\users\brecht\appdata\local\temp\tmpnik5f4\pip.zip\pip\_vendor\urllib3\util\ss
l_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip
/
c:\users\brecht\appdata\local\temp\tmpnik5f4\pip.zip\pip\_vendor\urllib3\util\ss
l_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip
/
c:\users\brecht\appdata\local\temp\tmpnik5f4\pip.zip\pip\_vendor\urllib3\util\ss
l_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip
/
c:\users\brecht\appdata\local\temp\tmpnik5f4\pip.zip\pip\_vendor\urllib3\util\ss
l_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip
/
c:\users\brecht\appdata\local\temp\tmpnik5f4\pip.zip\pip\_vendor\urllib3\util\ss
l_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip
/
c:\users\brecht\appdata\local\temp\tmpnik5f4\pip.zip\pip\_vendor\urllib3\util\ss
l_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
  Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirmi
ng the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retr
ies exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:499:
 error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
'),)) - skipping
  Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip

C:\Python27>

Now I managed to install pip by using PyCharm instead of the terminal but I'm unable to install any package

Example below:

C:\Python27\Scripts>pip2 install sklearn
Collecting sklearn
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject
 Name Indication) extension to TLS is not available on this platform. This may c
ause the server to present an incorrect TLS certificate, which can cause validat
ion failures. You can upgrade to a newer version of Python to solve this. For mo
re information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html
#ssl-warnings
  SNIMissingWarning
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s 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-usa
ge.html#ssl-warnings
  InsecurePlatformWarning
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/skl
earn/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s 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-usa
ge.html#ssl-warnings
  InsecurePlatformWarning
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/skl
earn/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s 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-usa
ge.html#ssl-warnings
  InsecurePlatformWarning
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/skl
earn/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s 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-usa
ge.html#ssl-warnings
  InsecurePlatformWarning
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/skl
earn/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s 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-usa
ge.html#ssl-warnings
  InsecurePlatformWarning
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/skl
earn/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s 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-usa
ge.html#ssl-warnings
  InsecurePlatformWarning
  Could not fetch URL https://pypi.org/simple/sklearn/: There was a problem conf
irming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max
retries exceeded with url: /simple/sklearn/ (Caused by SSLError(SSLError(1, '_ss
l.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol
 version'),)) - skipping
  Could not find a version that satisfies the requirement sklearn (from versions
: )
No matching distribution found for sklearn
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_
.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s 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-usa
ge.html#ssl-warnings
  InsecurePlatformWarning
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming
 the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retrie
s exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:499: e
rror:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version')
,)) - skipping

C:\Python27\Scripts>
Reply
#2
All version after 2.7.9 --> comes with pip,you most remember to to selcet pip under install of Python 2.7 image.
You can try ensurepip:
From root C:\Python27 folder python -m ensurepip

If all fail just uninstall/reinstall with pip option selected.
Upgrade also pip to 18.1.
C:\Python27
λ python -m pip install --upgrade pip
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f...../pip-18.1-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 706kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-18.1
Test version in Scripts folder.
C:\Python27\Scripts
λ pip -V
pip 18.1 from c:\python27\lib\site-packages\pip (python 2.7)
So i have 3.7 as main version in Path,look here last in post how to use py to access all version installed
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020