I have troubles importing uproot in jupyter notebooks since some time ago. It worked fine before and it still works fine when importing it in my other python scripts, but when I try to import it in jupyter notebook it says ModuleNotFoundError: No module named 'uproot'
. I am using virtual environment and the problem is strange because the uproot
is surely installed in venv. Even if I try
!pip install uproot
import uproot
in one cell of the notebook, the output says:
Requirement already satisfied: uproot in ./.venv/lib/python3.6/site-packages (3.11.2)
Requirement already satisfied: awkward<1.0,>=0.12.0 in ./.venv/lib/python3.6/site-packages (from uproot) (0.12.20)
Requirement already satisfied: numpy>=1.13.1 in ./.venv/lib/python3.6/site-packages (from uproot) (1.18.1)
Requirement already satisfied: uproot-methods>=0.7.0 in ./.venv/lib/python3.6/site-packages (from uproot) (0.7.3)
Requirement already satisfied: cachetools in ./.venv/lib/python3.6/site-packages (from uproot) (4.0.0)
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-84117e7aebc9> in <module>
1 get_ipython().system('pip install uproot')
----> 2 import uproot
/usr/lib/root/6.18/lib/ROOT.py in _importhook(name, *args, **kwds)
531 except Exception:
532 pass
--> 533 return _orig_ihook( name, *args, **kwds )
534
535 __builtin__.__import__ = _importhook
ModuleNotFoundError: No module named 'uproot'
[EDIT] What I did now was to install jupyter-lab to venv and the problem seems to be deeper:
[In] !python3 -c "import uproot; print(uproot.__version__)"
[In] !which python3
[In] import uproot
[Out] 3.11.2
[Out] ...PATH.../.venv/bin/python3
----------------------------------------------
ModuleNotFoundErrorTraceback (most recent call last)
<ipython-input-9-f1317e967425> in <module>
2 get_ipython().system('which python3')
3
----> 4 import uproot
ModuleNotFoundError: No module named 'uproot'