Hello everyone,
I would like to import torch to do machine learning using TMVA. However, when I try to do so, I get a ModuleNotFound
error. I am currently doing this in the Jupyter Notebook for ROOT. When I run
import sys, subprocess
subprocess.run([sys.executable, '-m', 'pip', 'list'])
to see what packages I have installed in the ROOT Notebook’s environment, this is my output
Package Version
---------------------------- ----------
absl-py 1.4.0
anyio 3.6.2
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
arrow 1.2.3
asttokens 2.2.1
astunparse 1.6.3
attrs 22.2.0
backcall 0.2.0
beautifulsoup4 4.11.2
bleach 6.0.0
cachetools 5.3.0
certifi 2022.12.7
cffi 1.15.1
charset-normalizer 3.1.0
comm 0.1.2
contourpy 1.0.7
cycler 0.11.0
debugpy 1.6.6
decorator 5.1.1
defusedxml 0.7.1
executing 1.2.0
fastjsonschema 2.16.2
flatbuffers 23.1.21
fonttools 4.38.0
fqdn 1.5.1
gast 0.4.0
google-auth 2.16.1
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
grpcio 1.51.1
h5py 3.8.0
idna 3.4
ipykernel 6.21.2
ipython 8.10.0
ipython-genutils 0.2.0
ipywidgets 8.0.4
isoduration 20.11.0
jedi 0.18.2
Jinja2 3.1.2
joblib 1.2.0
jsonpointer 2.3
jsonschema 4.17.3
jupyter 1.0.0
jupyter_client 8.0.3
jupyter-console 6.5.1
jupyter_core 5.2.0
jupyter-events 0.6.3
jupyter_server 2.3.0
jupyter_server_terminals 0.4.4
jupyterlab-pygments 0.2.2
jupyterlab-widgets 3.0.5
keras 2.11.0
kiwisolver 1.4.4
libclang 15.0.6.1
llvmlite 0.39.1
Markdown 3.4.1
MarkupSafe 2.1.2
matplotlib 3.7.0
matplotlib-inline 0.1.6
metakernel 0.29.4
mistune 2.0.5
nbclassic 0.5.2
nbclient 0.7.2
nbconvert 7.2.9
nbformat 5.7.3
nest-asyncio 1.5.6
notebook 6.5.2
notebook_shim 0.2.2
numba 0.56.4
numpy 1.24.2
nvidia-cublas-cu11 11.10.3.66
nvidia-cuda-nvrtc-cu11 11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11 8.5.0.96
oauthlib 3.2.2
opt-einsum 3.3.0
packaging 23.0
pandas 1.5.3
pandocfilters 1.5.0
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.4.0
pip 22.0.2
platformdirs 3.0.0
prometheus-client 0.16.0
prompt-toolkit 3.0.36
protobuf 3.19.6
psutil 5.9.4
ptyprocess 0.7.0
pure-eval 0.2.2
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.21
Pygments 2.14.0
pyparsing 3.0.9
pyrsistent 0.19.3
python-dateutil 2.8.2
python-json-logger 2.0.6
pytz 2022.7.1
PyYAML 6.0
pyzmq 25.0.0
qtconsole 5.4.0
QtPy 2.3.0
requests 2.28.2
requests-oauthlib 1.3.1
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rsa 4.9
scikit-learn 1.2.1
scipy 1.10.0
Send2Trash 1.8.0
setuptools 67.6.0
six 1.16.0
sniffio 1.3.0
soupsieve 2.4
stack-data 0.6.2
tensorboard 2.11.2
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow 2.11.0
tensorflow-estimator 2.11.0
tensorflow-io-gcs-filesystem 0.30.0
termcolor 2.2.0
terminado 0.17.1
threadpoolctl 3.1.0
tinycss2 1.2.1
torch 1.13.1
torchaudio 0.13.1
torchvision 0.14.1
tornado 6.2
traitlets 5.9.0
typing_extensions 4.5.0
uri-template 1.2.0
urllib3 1.26.15
wcwidth 0.2.6
webcolors 1.12
webencodings 0.5.1
websocket-client 1.5.1
Werkzeug 2.2.3
wheel 0.38.4
widgetsnbextension 4.0.5
wrapt 1.14.1
and torch
is a part of this list. I am confused as to why I cannot import the PyTorch package. Has anyone encountered this problem, and does anyone have a solution? If it’s helpful, I have also downloaded ROOT through the snap
package manager on Ubuntu 22.04, which might be why I’m running into this problem.