Hi,

I already have a working ARTIQ environment installed which I use by running the sequences in a terminal, but I would like to run the sequences from a jupyter notebook. However, when trying to install jupyter, I realized that pip was not installed in the ARTIQ environment. When trying to install it using the command python -m ensurepip --upgrade, I get an error message because the repository containing the environment has been made immutable by the person creating it.

Hence my question is the following: Do I risk to create a conflict if I force the installation of pip in the ARTIQ environment?

Furthermore, once pip is installed (if I can), would the commands
pip install jupyter
python -m ipykernel install --user --name artiq-env --display-name "ARTIQ Environment"
jupyter notebook

be enough to be able to open a jupyter notebook that can run ARTIQ sequences as well as any python library ?

Thank you

    What installation method did you use for ARTIQ? Nix, MSYS2, Conda...?

    gferrero As long as you are not building firmware, I think the following works on a fresh installation of either Ubuntu Desktop 22.04.5 LTS or Ubuntu Server 22.04.5 LTS: (provided that you have taken care of installing git, pip, etc.)

    1. sudo apt install lld llvm
    2. git clone https://github.com/m-labs/sipyco.git ~/workspace/sipyco
    3. cd ~/workspace/sipyco && pip install .
    4. git clone https://github.com/m-labs/artiq.git ~/workspace/artiq
    5. cd ~/workspace/artiq && git checkout release-X -> replace X by the Artiq firmware version on your Kasli or Kasli SoC
    6. pip install .
    7. Test that you can access artiq_coremgmt (or any other Artiq command) straight from the terminal.
    8. If the Artiq commands are not found, then your python PATHs might be screwed up; fix them.

    We are running our lab based purely on python. nix only gets used for compiling firmware and that's done on a different computer.

    gferrero

    Hence my question is the following: Do I risk to create a conflict if I force the installation of pip in the ARTIQ environment?

    You can check my response on using pip in immutable environments like Nix here: https://forum.m-labs.hk/d/747-including-a-local-python-package-in-an-artiq-nix-shell/4.

    As @architeuthis mentioned, it depends on how you installed ARTIQ, since each setup has different ways to add Jupyter.

    @dtsevas's method works, but generally, it’s easier to maintain and more reliable to use an environment manager like Nix (on Linux) or MSYS2/Conda (on Windows). Here’s how you can go about it:

    • If you're using nix, add Jupyter by including ps.jupyter to the artiq flake:
      defaultPackage.x86_64-linux = pkgs.buildEnv {
              name = "artiq-env";
              paths = [
                # ========================================
                # EDIT BELOW
                # ========================================
                (pkgs.python3.withPackages(ps: [
                  # List desired Python packages here.
                  artiq.artiq
                  ps.jupyter
    • For MSYS2, install Jupyter via pacman from the MSYS2 repo. Use the clang64 version:
       pacman -S mingw-w64-clang-x86_64-python-jupyter_notebook
    • With Conda, install Jupyter from the conda-forge channel:
      conda install conda-forge::jupyter