maxisme
maxisme

Reputation: 4245

pip freeze not showing packages

For example if after installing Tornado with pip like this:

pip install tornado
Collecting tornado
...
Successfully installed backports-abc certifi singledispatch six tornado

pip freeze doesn't return tornado package in list, it just shows:

PyMySQL==0.7.2

also when I run easy_install it returns:

error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

What is going wrong?

Upvotes: 6

Views: 9653

Answers (3)

Omar
Omar

Reputation: 61

upgrade pip and it will work. I had the exact same problem. In my case it wasn't "sudo" related, but upgrading pip via pip install --upgrade pip solved the issue.

Upvotes: 0

Pro Q
Pro Q

Reputation: 5016

When using virtualenvwrapper or another virtual environment (which is probably not your case but is how I arrived at this question), you may have installed things using sudo which will install them for your entire system. (See here)

Therefore, pip freeze actually is working, you just haven't actually installed anything with that pip.

Upvotes: 5

Andriy Ivaneyko
Andriy Ivaneyko

Reputation: 22041

  1. I suppose reinstalling pip may help you:

    pip install --upgrade pip
    
  2. To fix easy_install problem add /lib/python2.7/site-packages/ to your PYTHONPATH:

    export PYTHONPATH=$PYTHONPATH:/lib/python2.7/site-packages/
    

Good Luck !

Upvotes: 1

Related Questions