LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-09-2017, 10:46 AM   #1
parth.s
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Rep: Reputation: Disabled
Installing libraries for multiple python versions


Hi Folks,

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
So I then downloaded the get-pip.py and ran:
Code:
[root@VM01 pshah]# python get-pip.py
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 978kB/s
Collecting wheel
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 9.2MB/s
Installing collected packages: pip, wheel
Successfully installed pip-9.0.1 wheel-0.30.0
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?
Thanks!
 
Old 10-09-2017, 11:45 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by parth.s View Post
Hi Folks,

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
So I then downloaded the get-pip.py and ran:
Code:
[root@VM01 pshah]# python get-pip.py
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 978kB/s
Collecting wheel
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 9.2MB/s
Installing collected packages: pip, wheel
Successfully installed pip-9.0.1 wheel-0.30.0
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.
 
Old 10-09-2017, 01:15 PM   #3
parth.s
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thanks for the reply.

Quote:
Originally Posted by TB0ne View Post
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 View Post
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.
 
Old 10-09-2017, 01:51 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by parth.s View Post
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:
  1. You have an internet connection (you say you don't)
  2. 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.
 
Old 10-09-2017, 05:22 PM   #5
parth.s
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
As it mentions here: https://pip.pypa.io/en/latest/installing I did a local install of pip but called the python executable for python 2.7.14.

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
>>>
 
  


Reply

Tags
pip, python, rhel7



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Libraries versions baronshark Slackware 2 09-20-2017 09:18 AM
Where to find new versions of Python after installing Python roll dyson ROCK 4 05-19-2016 10:06 AM
Installing multiple rpm package versions? metal_militia Linux - Newbie 5 08-19-2014 01:29 PM
multiple python versions mahsan3 Linux - Software 16 12-09-2013 08:16 AM
Installing Multiple Versions of Red Hat? tudmuf2b Linux - General 7 03-05-2003 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration