Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip freeze does not show all installed packages

I am using a virtualenv. I have fabric installed, with pip. But a pip freeze does not give any hint about that. The package is there, in my virtualenv, but pip is silent about it. Why could that be? Any way to debug this?

like image 396
blueFast Avatar asked Jun 06 '13 10:06

blueFast


People also ask

Why does pip freeze is not show all packages?

pip freeze does not output pip itself or packages for package management such as setuptools and wheel . These packages are not needed for porting the environment using requirements. txt mentioned above. Note that if you add the --all option to pip freeze , packages such as pip will also be output.

Does pip freeze show dependencies?

Since pip freeze shows all dependencies as a flat list, finding out which are the top level packages and which packages do they depend on requires some effort. It's also tedious to resolve conflicting dependencies that could have been installed because older version of pip didn't have true dependency resolution [1].

How do you see all pip installed packages?

To do so, we can use the pip list -o or pip list --outdated command, which returns a list of packages with the version currently installed and the latest available. On the other hand, to list out all the packages that are up to date, we can use the pip list -u or pip list --uptodate command.

What is the difference between pip list and pip freeze?

pip list shows ALL installed packages. pip freeze shows packages YOU installed via pip (or pipenv if using that tool) command in a requirements format.


2 Answers

I just tried this myself:

create a virtualenv in to the "env" directory:

$virtualenv2.7 --distribute env
New python executable in env/bin/python
Installing distribute....done.
Installing pip................done.

next, activate the virtual environment:

$source env/bin/activate

the prompt changed. now install fabric:

(env)$pip install fabric
Downloading/unpacking fabric
  Downloading Fabric-1.6.1.tar.gz (216Kb): 216Kb downloaded
  Running setup.py egg_info for package fabric   
...

Successfully installed fabric paramiko pycrypto
Cleaning up...

And pip freeze shows the correct result:

(env)$pip freeze
Fabric==1.6.1
distribute==0.6.27
paramiko==1.10.1
pycrypto==2.6
wsgiref==0.1.2

Maybe you forgot to activate the virtual environment? On a *nix console type which pip to find out.

like image 105
mawimawi Avatar answered Oct 19 '22 03:10

mawimawi


You can try using the --all flag, like this:

pip freeze --all > requirements.txt
like image 27
West1572 Avatar answered Oct 19 '22 04:10

West1572