pythonpython-3.xpipvirtualenv

How to Install virtualenv without pip?


I have a problem on pip.

As I use pyenv, using python version 3.7.x, there is no problem around pip.

$ /home/yuis/.pyenv/shims/pip --version
pip 19.2.3 from /home/yuis/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pip (python 3.7)

But using python version 3.6.x, I get a result that saying the pip is located on "~/.local", but not on "~/.pyenv".

This is very bad for me. Because the version what I need now is 3.6.x.

This incomprehensive pip behavior continues if I install other python 3.6 version, so python 3.6.12 and 3.6.11 will show this same path.

I guess this bug is most probably because some kind of conflict from the locally installed python and pyenv installed one.

$ /home/yuis/.pyenv/shims/pip --version
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.3.3 from /home/yuis/.local/lib/python3.6/site-packages/pip (python 3.6)

Now, I don't care much about pip anymore, because it seems an unsolvable issue. No time to waste. So now I want to try with virtualenv.

I need to install virtualenv first, because I can see this error.

$ virtualenv venv
pyenv: virtualenv: command not found

The `virtualenv' command exists in these Python versions:
  3.5.10
  3.7.6

Note: See 'pyenv help global' for tips on allowing both
      python2 and python3 to be found.

But both of the followings didn't work.

pip install virtualenv
/home/yuis/.pyenv/shims/pip install virtualenv
python -m pip install virtualenv

Now I have no idea what is going on on my machine and how to solve this problem.


Solution

  • Have you tried python -m virtualenv .venv?