...
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.
Activate the virtual environment:
Windows command prompt:
venv\Scripts\activate.bat
Windows Powershell:
.\venv\Scripts\Activate.ps1
If you get an error with:
running scripts is disabled on this system
Run:
Set-ExecutionPolicy Unrestricted
This allows you to run any Powershell scripts at will. For more detail: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.3
Linux and MacOS:
source venv/bin/activate
You should now see
(venv)
in the prompt line.Confirm the virtual environment uses Python 3.8:
python --version
Literally use
python
, none of the fancy stuff above.Example output:
Python 3.8.10