0

I want to do code analysis with pychecker but when it imports python code it doesn't use the packages from virtualenv, it uses the system wide one and the import fail.

Is there a way to install pychecker in a virtualenv or at least get it to just import the packages from the virtualenv?

nickponline
  • 25,354
  • 32
  • 99
  • 167

1 Answers1

0

Set your $PYTHONPATH environmental variable to the site-packages directory.

For me, pychecker was not able to find the configobj module. Since I use zsh (bash with lots of bells and whistles), I ran:

> find ~/venv-ops -name configobj.py
/Users/doug/venv-ops/lib/python2.7/site-packages/configobj.py
> export PYTHONPATH=/Users/doug/venv-ops/lib/python2.7/site-packages

and then pycheck worked fine.

PorkWonton
  • 55
  • 6
sweetser
  • 57
  • 3