[SOLVED] Installing libraries for multiple python versions
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
OS: RHEL 7.2
Goal: Install pip for python 2.7.14
Internet connection to server: No
I recently did a fresh install of RHEL on a VM, this came with python 2.7.5.
I did a parallel install of python 2.7.14 (using make altinstall) and python3.6.
Next, I used easy-install to install pip, but this installed pip for python 3.6:
Code:
[root@VM01 bin]# easy_install pip
Searching for pip
Best match: pip 9.0.1
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Installing pip3.5 script to /usr/local/bin
Using /usr/local/lib/python3.6/site-packages
Processing dependencies for pip
Finished processing dependencies for pip
I believe this installed it for the default python version or python 2.7.5, so I ran the same with python2.7.14:
Code:
[root@VM01 pshah]# /usr/local/bin/python2.7 get-pip.py
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
This tell me that the ssl library is not installed for my python 2.7.14 installation..
But again, both of these packages are available at the OS level
Code:
[root@VM01 pshah]# yum install openssl
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package 1:openssl-1.0.1e-42.el7_1.9.x86_64 already installed and latest version
Nothing to do
[root@VM01 pshah]# yum install openssl-devel
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package 1:openssl-devel-1.0.1e-42.el7_1.9.x86_64 already installed and latest version
Nothing to do
OS: RHEL 7.2
Goal: Install pip for python 2.7.14
Internet connection to server: No
I recently did a fresh install of RHEL on a VM, this came with python 2.7.5. I did a parallel install of python 2.7.14 (using make altinstall) and python3.6. Next, I used easy-install to install pip, but this installed pip for python 3.6:
Code:
[root@VM01 bin]# easy_install pip
Searching for pip
Best match: pip 9.0.1
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Installing pip3.5 script to /usr/local/bin
Using /usr/local/lib/python3.6/site-packages
Processing dependencies for pip
Finished processing dependencies for pip
I believe this installed it for the default python version or python 2.7.5, so I ran the same with python2.7.14:
Code:
[root@VM01 pshah]# /usr/local/bin/python2.7 get-pip.py
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
This tell me that the ssl library is not installed for my python 2.7.14 installation..But again, both of these packages are available at the OS level
Code:
[root@VM01 pshah]# yum install openssl
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package 1:openssl-1.0.1e-42.el7_1.9.x86_64 already installed and latest version
Nothing to do
[root@VM01 pshah]# yum install openssl-devel
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package 1:openssl-devel-1.0.1e-42.el7_1.9.x86_64 already installed and latest version
Nothing to do
Any thoughts?
Some obvious and confusing things here. You start by saying your server doesn't have an Internet connection...then you run a script that tries to download things from the Internet, and you're surprised it failed?
And you're then trying to use yum on RHEL...and you're not PAYING FOR RHEL, so that will fail as well. If you're not going to pay for RHEL, and this is a fresh installation, stop where you are and load CentOS instead. Then get an Internet connection, run the download script(s), and the yum command.
Some obvious and confusing things here. You start by saying your server doesn't have an Internet connection...then you run a script that tries to download things from the Internet, and you're surprised it failed?
But it did work for the default python installation.
Quote:
Originally Posted by TB0ne
And you're then trying to use yum on RHEL...and you're not PAYING FOR RHEL, so that will fail as well. If you're not going to pay for RHEL, and this is a fresh installation, stop where you are and load CentOS instead. Then get an Internet connection, run the download script(s), and the yum command.
We do have licenses for RHEL servers, but I can go ahead an confirm this part.
Thanks for the reply. But it did work for the default python installation.
Really? Then why did you post this:
Quote:
Originally Posted by parth.s
Code:
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
If you DO NOT have an Internet connection, how do you think things are going to be able to connect to an outside website???
Quote:
We do have licenses for RHEL servers, but I can go ahead an confirm this part.
Oh? Then why did you post this:
Quote:
Originally Posted by parth.s
Code:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
...that says you do NOT have a subscription/license? Running that yum command is ONLY going to work if:
You have an internet connection (you say you don't)
You have a valid subscription/license (the system says you don't)
Running the yum command now is only going to read the local DVD/repo....which will correctly report the highest version available is installed...since it cannot access the online repos.
Downloaded the .whl files for wheel, setuptools and pip and then ran the below:
[root@VMW01 pshah]# /usr/local/bin/python2.7 get-pip.py --no-index --find-link=.
Collecting pip
Collecting setuptools
Collecting wheel
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-9.0.1 setuptools-36.5.0 wheel-0.30.0
I believe calling pip2.7 will install packages for the python 2.7.14 now.
Tested this by installing the xlrd library (Note - I had the xlrd tarball in the local directory):
[root@VMW01 pshah]# pip2.7 install xlrd-1.1.0.tar.gz
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Processing ./xlrd-1.1.0.tar.gz
Building wheels for collected packages: xlrd
Running setup.py bdist_wheel for xlrd ... done
Stored in directory: /root/.cache/pip/wheels/b9/dc/43/e6acfa12bc48cdf3654dd7f44c66880548ea0322324bc6095f
Successfully built xlrd
Installing collected packages: xlrd
Successfully installed xlrd-1.1.0
[root@VMW01 pshah]# /usr/local/bin/python2.7
Python 2.7.14 (default, Oct 6 2017, 18:31:52)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlrd
>>>
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.