Skip to content

Python Installation

Amos Chua edited this page Aug 4, 2022 · 7 revisions

How to install python

1. Download the installer

  • Get the Python 3.10.6 Installer from the official site, and install it.

    • see here if you're not on 64-bit Windows
    • You may use any version 3.7 or higher
  • Alternatively if you're using Chocolatey, just do choco install python

2. Run the installer

  • Make sure you select Add to Path on installation process.
    • see here on how to fix, if you missed that step

To check that you've installed it properly, you can open a shell (either CMD or PowerShell on Windows) and type in: python --version
It should return you the Python version, like so:
PythonVer

3. Set up the enviroment

Option 1: Global Environment (NOT RECOMMENDED)

  • After cloning the repository, open up a shell (either CMD or PowerShell on Windows)
  • Navigate to the repository folder
  • Use the command: pip install -r requirements.txt

Here's an example:
global
I used cd to navigate to the location where my Lapis folder is

Option 2: Virtual Environment

  • After cloning the repository, open up a shell (either CMD or PowerShell on Windows)

  • Navigate to the repository folder.

  • In the root of the repository, create a virtual environment using python -m venv venv
    Example:
    makevirtualenv

  • Activate the virtual environment using call venv\scripts\activate.bat in Command Prompt

    • The command is venv/scripts/activate in PowerShell
    • Note: You can deactivate the venv by using the command deactivate
  • Use the command pip install -r requirements.txt to install the required modules
    Example:
    virtualdependencies

    • Use pip install wheel, if the above commands throw errors