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! 🙂”

Mohamed SAKHRI
Mohamed SAKHRI

I'm the creator and editor-in-chief of Tech To Geek. Through this little blog, I share with you my passion for technology. I specialize in various operating systems such as Windows, Linux, macOS, and Android, focusing on providing practical and valuable guides.

Articles: 1378

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *