2.4. Initialising a project
Setup repository
-
In Github, click the + icon in the top right and select new repository.
-
Give your repository a name and a description.
-
Select whether it's private or public (can be changed).
-
Toggle README which creates a markdown file which will be displayed when viewing the repository.
-
Select python from the .gitignore, this is a default list of files and extensions to not include in the repository.
-
Add a licence if needed.
-
Open VSCode (connect to WSL if installed), and select clone repository, navigate to where you want your project to be saved.
Create virtual environment
In the terminal:
Initialise uv:
uv init
Create a virtual environment:
uv venv
Activate the virtual environment:
.venv\Scripts\activate
Now the virtual environment is activated any libraries installed will be in this environment.
You can install libararies using 'uv add {package name}':
uv add polars
This will install the polars libarary and update the pyproject.toml file with the package.