Print the interpreter: run python -c "import sys; print(sys.executable)". Expected: the path is the virtual environment or conda environment you intended.

Install into that exact interpreter: run python -m pip install ipython. Expected: pip reports IPython and its dependencies installed for that environment.

Verify: run python -c "import IPython; print(IPython.__version__)". Expected: a version number prints with no error.

If this happens in Jupyter, install ipykernel into the same environment and re-select that kernel in the notebook. Expected: the kernel name in the notebook matches the environment from step 1.

In CI, add ipython to the dependency file the job actually installs instead of relying on a preinstalled image package. Expected: a clean job passes the import check in step 3.