Test Pixi Environment#
Goal#
Test if the Pixi environments actually work in VS Code by importing and checking versions of key packages.
How to Use Pixi Environment in VS Code Notebooks#
Important: Make sure you’ve registered the pixi environment as a Jupyter kernel first:
Navigate to your pixi environment folder (e.g.,
pixi/appose_napari_ai/)If you haven’t created the pixi environment run
pixi installon the command line:
pixi install
To register the environment (so VS Code can see it) run:
pixi run python -m ipykernel install --user --name=appose_napari_ai --display-name "Pixi (appose_napari_ai)"
Note: After registering a new environment, you may need to restart VS Code for the environment to appear in the kernel selector.
In VS Code, click the kernel selector (top right of notebook)
Choose “Select Another Kernel” → “Jupyter Kernel” → “Pixi (appose_napari_ai)”
If the imports below work without errors, your pixi environment is properly configured!
Testing Package Imports#
import appose
print(appose.__name__)
appose
import napari_ai_lab
print(napari_ai_lab.__version__)
0.0.2.dev64+nogit.ge997cceb4