Discover use cases
News Post

Installing python packages on qBraid

Product

Method 1: Use the qBraid CLI

With qBraid, users get full access to their jupyter lab terminal to allow for the full breadth and control that a developer would expect. To pip install any package into a python environment the qBraid CLI allows for the simplest and greatest control over the installation process. Here’s a quick example on how to install seaborn into the qiskit (0.42.1) environment on qBraid.

First, we’ll open the terminal and check which environments are installed

```bash

qbraid envs list

```

Output:

The list of environments that are installed

Choose the environment you’d like to install the package. For example, to add seaborn to the `qiskit` environment, let’s activate it with the following command:

Activating the environment similar to conda

Voilá you now have activated the qiskit environment and can treat the pip install just like any other installation you would perform on your own computer.

The terminal also simplifies adding access to quantum computers provided by Amazon Braket without any cloud setup. Simply run the command `qbraid jobs add <environment_name>` to add the necessary packages to run quantum jobs!

Method 2: Lab Environment Manager

With the Environment Manager you can have access to a visualized installment process of quantum computing packages. Open the Environment Manager sidebar, and find the environment in which you want to install the package. Using the environment manager to install packages assist you with versioning and dependency conflicts with friendly notifications.

Open the drop down menu for the environment and click more…

Once you open the Environment Details page search for the package that you want to install in the package list panel

If the package is not installed just click Enter to then pick the version in which you want to install the package:

After confirming the package version, click Enter to install the package!

Method 3: iPython Magic Command %

Oftentimes many users will use the `!` symbol to pip install. In recent Jupyter versions, %pip is typically available by default, so it's recommended to use `%pip install` for package installations within Jupyter and qBraid Notebooks to ensure that the package is available within the qBraid environment where you're working. If you're collaborating or sharing the notebook with others, using %pip install is especially preferable to avoid any potential compatibility issues related to the installed packages within the Jupyter kernel.

Make sure to use the magic command

About qBraid

qBraid is the definitive cloud platform for quantum software development. With proven usage across the globe, qBraid’s users avoid hard installation processes for quantum software. Dive deep into complex algorithms related to financial optimization, quantum machine learning and more - all on one platform. qBraid is on YouTube, LinkedIn, and Twitter.

For more information on qBraid visit: https://www.qbraid.com

Media Contact

Ricky Young

Email: contact@qbraid.com

Phone: 2487959039