My python is 2.7.5,
-bash-4.2$ python --version
Python 2.7.5
By default it doesn't have python pip.
My Linux is Redhat ERHL 7.3.
-bash-4.2$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
I have also checked that I don't have python-pip in Linux repository.
-bash-4.2$ yum search python-pip
Loaded plugins: product-id, rhnplugin, search-disabled-repos, subscription-manager
*Note* Spacewalk repositories are not listed below. You must run this command as root to access Spacewalk repositories.
cloudera-manager 7/7
Warning: No matches found for: python-pip
No matches found
My way to install pip is using get-pip.py
.
I got the get-pip.py
from https://packaging.python.org/installing/
The download link is https://bootstrap.pypa.io/get-pip.py
I downloaded it for my windows laptop and ftp upload it to the Linux server.
When I ran python get-pip.py
.
It tried a connection to the Internet.
-bash-4.2$ python get-pip.py
Collecting pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x35755d0>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x3575a90>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/pip/
Question:
- Where does it connect to?
- Can I setup a private repository?
- Is it pypi repo?
- Can I use static web server for this pypi repo?
- How can I set the get-pip.py to point the connection to my private repo?
get-pip.py
? The version I found has a base85 blob representing a zip file at the end, though just downloading from the source seems much more reasonableget-pip.py
, changingwith open(pip_zip, "wb") as fp
towith open ("pip.zip", "wb") as fp
. Removebootstrap(tmpdir=tmpdir)
. Run it, unzippip.zip
, and copy the newpip
directory to/usr/lib/pythonX.Y
or wherever your system keeps Python libraries. I'm not posting this as an answer because I consider it "hackish" and badensurepip
.