How do I list my pip-installed packages inside a venv?

10,748

I resolved this problem by creating a new venv for my project and switch to it. Then, when I activate the venv and "pip list" into it, I list only venv packages. I think this problem happens when you rename project folder or venv folder or move those files maybe to reorganise your project structure.

Share:
10,748
orome
Author by

orome

"I mingle the probable with the necessary and draw a plausible conclusion from the mixture."

Updated on July 26, 2022

Comments

  • orome
    orome almost 2 years

    I have successfully activated a virtual environment and installed packages there, but when I try to list those packages with pip list I get the list of global packages, not those in the activated venv.

    $ source ./venv/bin/activate
    [venv] pip list
    # ... global 2.7 packages are listed
    [venv] pip3 list
    # ... global 3 packages are listed
    

    but

    $ cd venv/lib/pythonXX/site-packages
    $ ls
    # ...venv's installed packages are listed
    

    even though python -version correctly lists the venv's Python (and not any global version).

    How do I list my pip-installed packages inside a venv?