Skip to content
Advertisement

No module named pip which using virtualenv-based python

When running the system-installed python, I can find pip:

JavaScript

However, if I create a virtualenv with this python3 and activate it, then I can no longer find pip:

JavaScript

I am completely baffled by this.

What is it about reading through a symlink that could make pip disappear?

Advertisement

Answer

The python’s venv module introduced in python 3.3 is different from virtualenv and has a subset of virtualenv‘s features.

From https://virtualenv.pypa.io/en/latest/

The venv module does not offer all features of this library, to name just a few more prominent:

  • is slower (by not having the app-data seed method)
  • is not as extendable, cannot create virtual environments for arbitrarily installed python versions (and automatically discover
    these),
  • is not upgrade-able via pip,
  • does not have as rich programmatic API (describe virtual environments without creating them).

So an environment created using venv does not have a separate pip installed so I would recommend using virtualenv instead.

You can install the virtualenv module by running

JavaScript

Create a new virtualenv in the current directory –

JavaScript

or you can also use

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement