Skip to content

Latest commit

 

History

History
166 lines (117 loc) · 4.23 KB

File metadata and controls

166 lines (117 loc) · 4.23 KB

Install under pixi

Here you can find the instructions to install pyslam under pixi and a very concise pixi primer.


Install pyslam with pixi

Currently, pixi support is experimental and may encounter issues with building and linking.

Follow the steps reported below:

Install pixi

curl -fsSL https://pixi.sh/install.sh | sh

Reference: https://pixi.sh/latest/#installation

Activate pixi shell

From the root folder of this repository, run

pixi shell 

Launch the pyslam install script

Then, from the root folder, run

./install_all.sh

This script will prepare the pixi-dedicated pyslam environment, and build the required thirdparty packages. Under the hood, the script install_all.sh calls the pixi-specific script scripts/install_all_pixi.sh.

Launch a main pyslam script

Once you have activate the pixi shell in your terminal, you're ready to run any main script.


Pixi primer

Initialize a Project

From within your project folder:

pixi init

This creates a pixi.toml (like pyproject.toml) describing your environment.

Add dependancies

Conda packages (from conda-forge):

pixi add numpy scipy matplotlib

Pip packages:

pixi add pip
pixi run pip install opencv-python

Then manually edit pixi.toml to reflect pip-installed packages:

[tool.pixi.pip-dependencies]
opencv-python = "*"

Run Commands in Environment

To test the environement:

pixi run python -c "import numpy; print(numpy.__version__)"
pixi run python -c "import cv2; print(cv2.__version__)" 

Other examples:

pixi run python script.py
pixi run jupyter notebook

Enter an interactive shell

pixi shell

This opens a shell with pixi enviornment variable already set and you don't need anymore to use pixi run ...<python command>.

Add specific platform targets

Add specific platform targets (e.g., cross-platform builds):

[tool.pixi]
platforms = ["linux-64", "osx-arm64", "win-64"]

Remove the local pixi environment

To delete the environment associated with the current project (i.e., clean slate):

pixi clean --all

This removes:

  • The current environment’s packages
  • The build cache
  • Any temporary/lock artifacts

You can then rebuild it cleanly with:

pixi install

Table of commands

This is a recap table:

Command Description
pixi init Initialize a new project
pixi add <pkg> Add a dependency
pixi install Re-resolve and install dependencies
pixi run <cmd> Run a command in the environment
pixi shell Enter an interactive shell
pixi remove <pkg> Remove a package
pixi list List installed packages
pixi export --format toml Export environment definition as TOML
pixi update Update dependencies and re-lock
pixi clean --all Remove the local pixi environment

References