On my conda environment importing torch from command line Python and from a jupyter notebook yields two different results.
Command line Python:
$ source activate GNN
(GNN) $ python
>>> import torch
>>> print(torch.__file__)
/home/riccardo/.local/lib/python3.7/site-packages/torch/__init__.py
>>> print(torch.__version__)
0.4.1
Jupyter:
(GNN) $ jupyter notebook --no-browser --port=8890
import torch
print(torch.__file__)
/home/riccardo/.local/lib/python3.6/site-packages/torch/__init__.py
print(torch.__version__)
1.2.0+cu92
I tried the steps suggested in Conda environments not showing up in Jupyter Notebook
$ conda install ipykernel
$ source activate GNN
(GNN) $ python -m ipykernel install --user --name GNN --display-name "Python (GNN)"
Installed kernelspec GNN in /home/riccardo/.local/share/jupyter/kernels/gnn
but that did not solve the problem.