A Python virtual environment is a self contained environment with a specific Python version and package versions. Different virtual environments can be used for different projects to maintain consistency.
If you haven’t already, download and install Python 3.8: https://www.python.org/
If you already have Python 3.7 or below installed, you must install Python 3.8 (you do not need to uninstall the other version(s)). This is because of a package dependency which requires Python 3.8 or greater.
Python 3.8.10 or later is recommended, otherwise you will have
pip
issues.
If you have Python 3.9 or above installed, you’re probably fine. Probably. Autonomy code is designed and tested on Python 3.8 so use a different version at your own risk.
Open the console in the repository root.
Example:
C:\Users\Username\computer-vision-python
Create a virtual environment called
venv
by running:[python] -m venv venv/
, where[python]
is Python 3.8 (e.g.python
,python38
).You can check which version of Python it is by running
[python] --version
If you move the repository to a different path after creating a virtual environment, you will have to delete the
venv
directory and repeat this step. Additionally, if your virtual environment breaks for any reason, you can always delete thevenv
directory and repeat this step for a fresh environment.Do not use any name other than
venv
. Otherwise the linters and formatters will break.