13

So, the title basically covers my question. I've created a project using virtualenv, e.g. I have to

source ./env/bin/activate 

to run my script.

When I try creating an executable using:

pyinstaller --onefile <myscript.py>

None of the virtualenv packages are included; just the ones that are installed globally. I have a requirements.txt file that contains all of the modules I need. Is there a way to have pyinstaller point to that for the needed modules, or is there another way?

Topher Sikorra
  • 141
  • 1
  • 1
  • 4
  • Maybe this helps: https://stackoverflow.com/questions/48629486/how-can-i-create-the-minimum-size-executable-with-pyinstaller – Valentino Mar 18 '19 at 21:57

1 Answers1

12

As Valentino pointed out by looking at How can I create the minimum size executable with pyinstaller?

You have to run PyIntaller from inside the virtual environment:

(venv_test) D:\testenv>pyinstaller
Alvaro Rodriguez Scelza
  • 3,031
  • 1
  • 27
  • 40