Pixi – To create finely tuned development environments

“Whether you’re using macOS, Linux, or Windows, if you’re a developer, Pixi might catch your interest. This project, written in Rust and adorned with the “apericube” logo, serves as more than just a package manager. It operates on the Conda ecosystem, enabling you to effortlessly install the necessary libraries and tools for your projects.

Pixi is both free and open source, heavily leveraging Cargo for those familiar with it. It boasts compatibility with a range of languages, including Python, R, C/C++, Rust, Ruby, and more. Notably, it facilitates the replication of identical environments across operating systems without the need for Docker, thanks to the lockfiles it automatically generates.

To install Pixi on Linux and macOS, execute the following command:

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

On Windows, open PowerShell and enter:

iwr -useb https://pixi.sh/install.ps1 | iex

Creating a project is a breeze:

pixi init pixi-hello-world
cd pixi-hello-world

Add dependencies with:

pixi add python

Specify a version if needed:

pixi add python==3.10

Craft your code, like this hello_world.py example:

def hello():
    print("Salut tout le monde !!!!")

if __name__ == "__main__":
    hello()

Execute it in your environment:

pixi run python hello_world.py

Alternatively, organize it into a task:

pixi task add hello python hello_world.py

Now, execute the task:

pixi run hello

Access a Shell in the environment:

pixi shell

Once satisfied, build it:

pixi build

This retrieves a Conda package ready for deployment elsewhere. In essence, Pixi is incredibly practical for establishing a precise environment with the correct packages and versions. It ensures isolated, easily reproducible, and shareable environments.

Give it a try soon! 🙂”

5/5 - (1 vote)

See also  How to limit the bandwidth of a network interface with Wonder Shaper
Mohamed SAKHRI

I am Mohamed SAKHRI, the creator and editor-in-chief of Tech To Geek, where I've demonstrated my passion for technology through extensive blogging. My expertise spans various operating systems, including Windows, Linux, macOS, and Android, with a focus on providing practical and valuable guides. Additionally, I delve into WordPress-related subjects. You can find more about me on my Linkedin!, Twitter!, Reddit

Leave a Comment