CircleCI cannot find comm>=0.1.3

I was having an issue of CircleCI not being able to find the package comm>=0.1.3 such that my CI failed with the following error:

ERROR: Could not find a version that satisfies the requirement comm>=0.1.3 (from ipywidgets->jupyter) (from versions: 0.0.1)
ERROR: No matching distribution found for comm>=0.1.3 (from ipywidgets->jupyter)

This arose from the installation of jupyter, which requires the dependency ipywidgets that requires comm>=0.1.3. According to PyPI, the latest version of comm is 0.1.4, so it confused me why CircleCI was not about to find comm >= 0.1.3. I wonder how I can work around with this issue. Below is the content of config.yml that I was using with CircleCI:

version: 2.1

      # Note that ubuntu with versions later than 2022 triggers an interative prompt that gets CI stuck
      image: ubuntu-2004:202107-02
      PYTHON_VERSION: "3.8"
      - checkout
      - run:
          name: Install nbconvert for testing notebooks
          command: |
            pip install --upgrade pip
            pip install jupyter nbconvert
      - run:
          name: Install the sampling_simulator package
          command: |
            pip install .
      - run:
          name: Test notebooks
          command: |
            for notebook in *.ipynb; do
              jupyter nbconvert --to script "$notebook"
              python "${notebook%.ipynb}.py"

  version: 2
      - test

Thanks in advance!

Your issue is somewhat outside of the CircleCI ecosystem and is more of an issue with the python/pip environment found in a modern Ubuntu environment.

The starting problem is the fact that there are 2 python environments within the Ubuntu image, python (2.7.18) and python3 (3.9.4), pip then mirrors this with there being pip (19.2.3) and pip3 (20.2.3).

I do not know much about the python environment and just about nothing about nbconvert, but as nbconvert states, it currently supports Python 3.7-3.9 I am guessing that you will need to use pip3 rather than pip as the control program.

What I can say is that by using pip3 the “Install nbconvert for testing notebooks” step does run and does find a comm-0.1.4 to install, but also reports a dependency error along the way.