Search code examples
pythonpython-3.xnuitka

How can I use nuitka with virtualenv


I am using nuitka for my project. It has some 3rd party modules as dependencies and I am using virtualenv.

How can I use nuitka with virtualenv?


Solution

  • While compilation worked perfect, I had import error at execution time on all packages that were installed in virtualenv folder, even is virtualenv was activated by workon.

    Extending PYTHONPATH before running the resulted .exe has solved the issue though:

    export PYTHONPATH=$PYTHONPATH:/home/pystack/.virtualenvs/occam_1.0_pandas_0.16.2/local/lib/python2.7/site-packages/
    

    Probably using the --recurse-directory=MODULE/PACKAGE would also do it.