I am experiencing a discrepancy between the Python version reported in the Jupyter notebook startup banner and the version shown when I query python --version
within the notebook. The startup banner indicates Python 3.11.9, but when I run !python --version
, it returns Python 3.11.7.
Steps I did:
- base conda has 3.11.7 version
- conda create –prefix ~/.conda/pypypy python=3.11.9
- conda activate ~/.conda/pypypy
- python -m ipykernel install –user –name pypypy
Expected Behavior:
The Python version queried within the notebook should match the version indicated in the startup banner.
Troubleshooting Done:
- Checked the environment’s kernel specification file (
kernel.json
) to ensure it points to the correct Python executable.
(/home/karzymatov/.conda/pypypy) karzymatov@55f26f77b14d:~/mtb_join$ jupyter kernelspec list
Available kernels:
python3 /home/karzymatov/.conda/pypypy/share/jupyter/kernels/python3
pypypy /home/karzymatov/.local/share/jupyter/kernels/pypypy
cat /home/karzymatov/.local/share/jupyter/kernels/pypypy/kernel.json
{
"argv": [
"/home/karzymatov/.conda/pypypy/bin/python",
"-Xfrozen_modules=off",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "pypypy",
"language": "python",
"metadata": {
"debugger": true
}
- Ensured that the notebook is using the intended kernel.
Could someone help explain why this discrepancy occurs and how to ensure that the notebook uses the correct Python version as indicated in the startup banner?