Skip to main content

Python

Let's install Python! Python is a very easy-to-learn language, that we used to serve the website.

Install Python

Check the version

Be sure to select the correct version! You can find the version required for Nantral Platform in the file backend/.python-version. Currently, we use Python 3.10.

Download and install the Python version from the Microsoft Store.

After the installation, check that it works properly:

  • Open a new terminal
  • Type this command and press ENTER to run it:
    python3 --version
  • You should see the Python version on a new line: Python 3.xx
The command does not work or the version is not python3.10, what can I do? 😭

Sometimes you can have multiple versions of python installed on your system: in this case, using python can refer to another version of python (for instance, it refers by default to python2 if it is installed).

To avoid this, you can precise which version you want to use by adding the version to the command: try to run python instead of python3, to get the correct version, or python3.7 for example.

Also notice that on Windows, python is sometimes replaced by py only: in this case, you can precise the version by runnning py -3 for example.

Once you have found the command that works for you, memorize it: in the following, we will always use python or python3 but you might need to replace it by the command which works for you.

If the command is still not recognized, try to close and reopen your terminal, or try to reboot your computer to refresh the available commands.

Install Pipenv

Pipenv will be our dependency manager, to handle dependencies of the project.

  1. Ensure that pip is correctly installed and upgrade it:
    python3 -m ensurepip --upgrade
  2. Then, run this command into PowerShell to install pipenv:
    python3 -m pip install --user pipenv
  3. Add the pipenv command to your PATH:
    [Environment]::SetEnvironmentVariable("PATH", $Env:PATH + ";$($(get-item $(python -m site --user-site)).parent.FullName)\Scripts", [EnvironmentVariableTarget]::User)
  4. Close and reopen your terminal to refresh the PATH.
  5. Finally let's test the installation:
    pipenv --version

That's it! You finished to install python, congratulations 🥳