When I want use torch in jupyter, I got this error
ModuleNotFoundError: No module named 'torch'
but I check that torch is installed already. following:
>>> python -c "import torch; print(torch.__version__)"
1.10.2+cu102
It is confirmed in Ubuntu CLI, but there is an error in jupyter only.
How can I fix it??
- OS : Linux(Ubuntu 18.04)
- Python : 3.6
2
Answers
You have to install torch in the current jupyter kernel.
Run within your script:
See Details here.
Ubuntu CLI is not the same environment with jupyter.
In Jupyter run this command
%pip install <package name>