1
votes

I am using RedHat 7.2 and I do not have root access. By default, python2.7 was installed by the administrator. But I needed to upgrade the python version. So, I installed python3.7 locally in my user account.

To install pip in the system, I downloaded the file "get-pip.py". However, when I run python get-pip.py --user , pip is installed for python2.7. And, all the packages installed using pip get installed for python2.7.

But, when I run python3.7 get-pip.py --user, the following error appears.

    Traceback (most recent call last):
  File "get-pip.py", line 22318, in <module>
    main()
  File "get-pip.py", line 198, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip._internal.main
zipimport.ZipImportError: can't decompress data; zlib not available

Then I installed zlib library. but still the problem is not solved. I have already checked that both the python2.7 are python3.7 are working.

Thanks in advance for your answers.

1
try python3 get-pip.py --user. - Evan Gertis
How did you install Python 3.7? Did you compile it from source before zlib was installed? - Brian
did you try using pip3 or pip3.7 command? - Hashir Baig

1 Answers

0
votes

Do you use Mac/Linux or Windows?

For Windows it is "pip install", whereas for Mac and Linux, it is "sudo pip3 install".