Anaconda - virtual python environments
Anaconda is an application that allows setting up virtual Python environments. You define the Python version and packages to include with each virtual environment and then Anaconda creates a self-contained Python environment for you.
Prerequisits
To setup an Anaconda (conda for short) environment you need to download the distribution for your operation system and then follow the online installation guide.
Framework virtual python environment
To create a virtual python environment for the database functions of the framework you can use the file xspatula_py_3.12.yml. It is included in the Xspatula repo under the path ./anaconda and shown below.
name: xspatula_py_3.12
channels:
- conda-forge
- defaults
dependencies:
- python=3.12
- numpy
- pandas
- psycopg2
- python-dotenv
Open a Terminal window and navigate to the folder that contains xspatula_py_3.12.yml. Then execute the command conda env create as shown below. When you start a notebook in the framework package for the first time you will be asked to select Python environment. Select the xspatula_py_3.12.yml as the Python environment.
conda env create --file xspatula_py_3.12.yml
If you want to remove the virtual environment, run the command:
conda remove --name xspatula_py_3.12 --all