Installation#

Note

If you’re familiar with the python ecosystem that’s all you need.

$> pip install luxos

These are detailed end-to-end instructions how to:

  • install a python interpreter (usually done once per python release, eg. 3.10.1, 3.12.1 etc.)

  • create as many virtual environment venv needed (this is done once per new environment)

  • install luxos package in a venv

Install a python interpreter#

This step is done usually once per new python release, and it can be done by an administrator (in which case the install might be read-only to the user).

Head to python and download the most recent installer following the on-screen instructions.

Once you have your system wide python installed, you can work creating a virtual env.

Hint

No matter how you installed your main python interpreter, just make sure you’re installing python3.x and not python2.x, this command should show something reasonable:

$> python3 --version
Python 3.12.3

Virtual environments#

A virtual environment is a filesystem directory holding executable, libraries and all sort of ancillary files (”data”): it is initially created using the python interpreter itself, activated using an activate script (that sets the PATH to the directory) and files are installed using a package manager that installs a package.

In case of python:

  • a package manager could be pip or conda

  • a package can be a python wheel .whl file or a conda file (.conda)

In general you can have multiple virtual environments with different installed packages like an environment to run tests, another to create documentation and so on.

The lifecycle of a virtual environment is pretty simple once a python interpreter is installed:

  1. create a new environment in a directory (this is usually done once per environment)

  2. activate the newly create environmen (this step is needed every time you start a new shell process)

  3. install/remove packages using the package manager

Create a new environment#

This will create a new environment under venv under the current directory

This will create a new venv directory in the current working dir:

$> python3 -m venv $(pwd)/venv

Activate the environment#

Once the environment has been created, every time a new shell is started, some configuration has to be done in order to set the correct environmnetal variables as PATH.

This configuration is called activate the environment.

$> source $(pwd)/venv/bin/activate

Uisng the newly creating environemn#

Once activate an environment you can use the packages manager to install/uninstall/update the packages in such environment: changes will happen only in the environment directory (in our case $(pwd)/venv or %CD%\venv).

to list currently installed packages

pip list

to install a package

pip install luxos

to upgrade a package

pip install --upgrade luxos

to remove a package

pip uninstall luxos