GPU not working on jupyter notebook

I am having problem to run gpu on jupyter notebook.

I run on jupyter notebook:
import torch
torch.cuda.is_available()

giving False

but on terminal it is giving True.

Any help?

Run the following commands in both terminal and jupyter notebook and paste the output here.

import sys

sys.executable

sys.path

I solved the issue. The problem was with Ubuntu system update. I just restarted