Close

virtual environments

A project log for Indicating when eye tracker software is in use

Give me a minute

matt oppenheimmatt oppenheim 07/07/2020 at 08:550 Comments

I use a virtual environment in Python to develop the script. Why? Apart from this being 'best practice', using a virtual environment with only the libraries that you need for the script installed reduces the size of the stand alone executable. I have tried all the common tools for creating a stand alone executable. The two I have most success with are:


pyinstaller

cx_freeze


Currently I favour pyinstaller.

I put a file called 'freeze.txt' onto the GitHub site. This contains all the extra installed libraries in the virtual environment. This enables another developer to copy my virtual environment development setup. I don't know if anybody else will ever want to develop this code, but having the freeze file is a good habit to get into. This is produced from within the virtual environment using the command:


pip freeze > freeze.txt

Discussions