...
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.
If you have Python 3.9 or above installed, you’re probably fine. Probably. The bootcamp was 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\autonomy-bootcamp-2023
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.If you want to call the virtual environment by a different name, replace
venv/
with the name you want. Virtual environments are identified by their path, so different projects with the samevenv
virtual environment name is fine.Example:
C:\Users\Username\autonomy-bootcamp-2023\venv\
andC:\Users\Username\computer-vision-python\venv\
are different.
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
Open
requirements.txt
MacOS: Remove
+cu117
from bothtorch
andtorchvision
Windows and Linux:
If you have a CUDA capable GPU but don’t want to use it for some reason, change
+cu117
to+cpu
for bothtorch
andtorchvision
If you don’t have a CUDA capable GPU, don’t change anything.
Download and install required packages:
pip install -r requirements.txt
This will install in your virtual environment under
venv
. The rest of your system is unaffected.
Done!
...