0

I'm using a remote server, which some others use together.

There are several versions of python installed.

I need python 3.6 version, and I can run it with /bin/python3.6 command.

And I also want to make a virtualenv of the version, so I tried /bin/python3.6 -m pip --version

But it showed

/bin/python3.6: No module named pip

When I checked the lib directory, ll /usr/lib/python3.6/site-packages/

total 0 drwxr-xr-x 2 root root 6 Dec 20  2017 __pycache__

It seems that the server has python3.6, but misses pip for that, right?

How can I resolve this, with the minimum modification?

The server is centos7.

Any thought or comment appreciated :)

wjandrea
  • 28,235
  • 9
  • 60
  • 81
yoon
  • 1,177
  • 2
  • 15
  • 28

2 Answers2

0

As drum mentioned at the comment, I installed pip referring to pip.pypa.io/en/stable/installing.

I ran the python file with /usr/bin/python3.6 get-pip.py.

After installing virtualenv, I faced virtualenv not found error.

You can solve the above error with the following link.(It was a path issue) Virtualenv Command Not Found

yoon
  • 1,177
  • 2
  • 15
  • 28
0

In case you don't want to modify the system Python you can just use the zipapp version of virtualenv to create a virtual environment at some arbitrary location with latest pip included (see https://virtualenv.pypa.io/en/latest/installation.html#via-zipapp).

wget https://bootstrap.pypa.io/virtualenv/virtualenv.pyz
python3.6 /full/path/to/downloaded/virtualenv.pyz ~/virtualenv

~/virtualenv/bin/python -m pip list 

That's probably the minimum harmful modification, and ensure that messing with the system python does not break your system python applications/environment.

Yeti
  • 841
  • 5
  • 26