Pyinstaller executable only works with virtual environment activated

Viewed 1195

I created a Python executable inside a virtual portable environment, created by Anaconda and the package conda-pack, with the following command on a terminal :

(venv) > pyinstaller --onefile --paths=src/ --exclude-module PyQt5 program.py

When I launch the built executable with the environment activated, the program works. Without the environment actitaved, nothing happens. After launching it, the executable stops (without any warnings or errors). The options --onefile and --exclude-module don't affect the results.

The modules of the virtual environment should be included inside the executable and then it shouldn't be needed to activate the environement. How to do so ?

Thanks.

1 Answers

This isn't a direct solution to your problem, but I was having the same issue and resolved it by using py2exe instead of pyinstaller.

Related