Detailed Installation Guide
If it's the first time you will use python, or there's a long time since you used it last, you can review some key concepts by reading some key concepts about python projects
Note
Due to legal reason, we can't use Conda at Infopro Digital, our activities are commercials.
Following some change in their policies during the past years, Conda is now free only for companies with less than 200 peoples, students, individuals.
As per recommended python development environments at Infopro Digital, this project use pyenv and poetry.
pyenv allows you to manage multiple versions of Python on a single machine.
poetry is a dependency management and packaging tool for Python.
Note
If you are on Windows, make sure you have WSL/2 installed and ready to run with an Ubuntu / Debian distribution.
Environment requirements
Step 1: System packages
With Python, you'll often use packages or libraries that need C/C++ build system to compile from sources.
As exemple, when installing a specific version of python with pyenv, some librairies are compliled for your system.
To ensure all of your compilation needs are covered, you'll install this apt packages :
apt install -y build-essential zlib1g-dev libssl-dev libffi-dev software-properties-common libbz2-dev libncurses-dev \
libncursesw5-dev libgdbm-dev liblzma-dev libsqlite3-dev libgdbm-compat-dev libreadline-dev python3-pip
Beaware that python3-pip will install (if not already installed) the latest version of python natively supported
by your distribution (3.10 for Ubuntu 22.04). You can either use python 3.10 or use the recommended
version (see file .python-version).
Step 2: Install pyenv
To install pyenv, run the following commands in your terminal:
Add the following lines to your~/.bashrc (or ~/.zshrc if you are using zsh) to configure pyenv:
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Reload your shell:
Step 3: Install a Python Version
Use pyenv to install the version of Python you want to use. For example, to install the latest Python 3.12:
Set this version as the global default version:
Step 4: Installing Poetry
To prevent any conflicts and ensure that your system or own application won't break your poetry install, we will
install poetry with pipx. For alternatives/manual installs, see documentation : https://python-poetry.org/docs/
- If you need to install
pipx, see https://pipx.pypa.io/stable/installation/ pipx install poetry
Poetry has the ability to create/use multiple virtual environment for your project. By default poetry will create
your project virtual environment in $HOME/.cache/pypoetry/virtualenvs. This is not the recommended way to do it
at Infopro Digital. If you don't have specific needs, we strongly suggest that you host your virtualenv(s) in your
project inside a .venv directory, your IDE will have an easier time managing it for auto completion / code insight.
To host your virtual env,
Setup RAG Core using Poetry
Step 1: Clone the project
Move to the project directoryStep 2: Install dependancies
Navigate to the directory where you cloned the project and run the following command:
🎉 Congrats
You're all set and ready to code ! 🧑💻
Setup your own project repository
Step 1: Create your repository
Create a new project:
- Click on the "+" button in the top bar and select "New project".
- Choose "Create blank project".
- Enter a Project name and optional Project description.
- Choose the Visibility level (Public, Internal, or Private).
- Click "Create project".
Step 2: Push the cloned project to your new GitLab Repository
- Navigate to the cloned project directory
- Remove the existing remote (origin) associated with the cloned repository:
- Add your new GitLab repository as the remote origin: Replace https://gitlab.com/yourusername/your-new-repository.git with the URL of your new GitLab repository.
- Push the cloned project to your new GitLab repository: If your default branch is not main, replace main with your default branch name.
Windows, with WSL2
Ensure you have WSL2 installed with a Debian/Ubuntu distribution.
curl https://pyenv.run | bash