2

I'm working on a remote Linux system without root permission. I want to install python and pip locally. I have managed to install python, but failed on pip. The command I use is as follows:

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user

The downloading succeeded, but when running the second command, I received the error message:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pip
Could not fetch URL https://pypi.python.org/simple/pip/: 
There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip

I also tried

python get-pip.py

But the error is the same. What's wrong with my commands? Thank you all for helping me!!!

pfc
  • 1,831
  • 4
  • 27
  • 50
  • how did you install python? The error is saying python was not compiled with ssl support: http://stackoverflow.com/questions/27952343/install-python-ssl-module-on-linux-without-recompiling perhaps try: `apt-get install python-pip` or `yum install python-pip` also: http://stackoverflow.com/questions/5937337/building-python-with-ssl-support-in-non-standard-location or reinstall python using the distributions package manager `apt-get` or `yum` or whatever it is. – jmunsch Dec 18 '16 at 04:10
  • I install python by wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz – pfc Dec 18 '16 at 04:14
  • and then extract, install, export the PATH, etc. – pfc Dec 18 '16 at 04:15

1 Answers1

1

In this case, you will find that can't import ssl too.

The solution is:

  1. Install openssl, yum install openssl openssl-devel

  2. Configure source code

  3. then open Modules/Setup, and un-comment following part

    #SSL=/usr/local/ssl
    #_ssl _ssl.c \
    #       -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
    #       -L$(SSL)/lib -lssl -lcrypto
    
  4. make & make install python from source code

Xing
  • 21
  • 6