I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2.
How can I install pip with Python 3?
Assuming you are in a highly restricted computer env (such as myself) without root access or ability to install packages...
I had never setup a fresh/standalone/raw/non-root instance of Python+virtualenv before this post. I had do quite a bit of Googling to make this work.
python3
for python
if you are python2 user.wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-x.y.z.tar.gz
tar -xzvf virtualenv-x.y.z.tar.gz
python3 virtualenv-x.y.z/virtualenv.py --python $(which python3) /path/to/new/virtualenv
source /path/to/new/virtualenv/bin/activate
virtualenv
package includes a standalone version of pip
and setuptools
that are auto-magically installed into each new virtualenv. This solves the chicken and egg problem.which python3
should give: /path/to/new/virtualenv/bin/python3
pip
is also available in the virtualenv via which pip
... should give: /path/to/new/virtualenv/bin/pip
Then... pip, pip, pip!
Final tip to newbie Pythoneers: You don't think you need virtualenv when you start, but you will be happy to have it later. Helps with "what if" installation / upgrade scenarios for open source / shared packages.
Ref: https://virtualenv.pypa.io/en/latest/installation.html