Skip to content

Instantly share code, notes, and snippets.

@lucnap
Last active September 26, 2020 08:34
Show Gist options
  • Save lucnap/fc3b67f6120fc26f8696064fec94de03 to your computer and use it in GitHub Desktop.
Save lucnap/fc3b67f6120fc26f8696064fec94de03 to your computer and use it in GitHub Desktop.
Compile python programs to Widows executable
Install PyInstaller
if using Virtual Env (very likely) compile spcifying the folder of the modules
Example:
pyinstaller main.py --paths venv\Lib\site-packages --onefile
otherwise you will get an error of module not found when moving the executable to another machine
This is very useful when using libraries like MySQLdb for example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment