Installation
Via pip
The easiest way is to simply install the package via pip:
pip install pyloggrid
Important
Requirements
- Windows:
You must have
gccandmakeinstalled. You can easily obtain them by following these steps:Install Chocolatey (a package manager for Windows) if you haven’t already. Open a Command Prompt or PowerShell with administrative privileges and run the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
After Chocolatey is installed, install
gccandmakeusing Chocolatey:choco install mingw choco install make
- Linux:
Ensure you have
clangand the necessary build tools installed, as well as libomp-dev. You can use the following commands to install them on Ubuntu:sudo apt update && sudo apt install clang build-essential libomp-dev
Warning
The Windows version is significantly less optimized than the Linux version, and does not support multithreading.
Manual installation (from source)
Note
For the Gitlab version (see Github vs Gitlab), replace https://github.com/hippalectryon-0/pyloggrid.git by https://drf-gitlab.cea.fr/amaury.barral/log-grid.git and cd pyloggrid/log-grid by cd log-grid.
The pip install installs the package in site-packages. The source installation installs the package locally, which is useful to make modifications to the source code.
If you want to install from source to site-packages after changing the code (such that you can import pyloggrid from anywhere in your virtual environment), run uv build after the instructions below.
Warning
If you decide to install from source to site-packages, we recommend changing the name of the local directory in order to make sure you’re not importing the local version instead of the site-packages version.
Linux
Note
This guide is written for Ubuntu 22.x. If you are using a different version of Linux, you may need to adapt the instructions.
Install git:
sudo apt install git
Clone the repository:
git clone https://github.com/hippalectryon-0/pyloggrid.git
cd pyloggrid/log-grid
Run the install script:
source ./install.sh
This script will install required packages and dependencies, create a Python virtual environment, and compile the C code.
Windows
Warning
The windows installation script may be less stable. Moreover, the windows version does not support multithreading.
Warning
The windows version has not been tested with newer releases.
Install git.
Clone the repository:
git clone https://github.com/hippalectryon-0/pyloggrid.git
cd pyloggrid/log-grid
Run the install script:
powershell.exe -ExecutionPolicy bypass
./install.ps1
This will download python locally and install MinGW via choco, download the required dependencies and compile the C code. It might ask for admin rights to install choco, and open popups during the python extraction.