How can I user Jupyter Notebook in Pytorch kernel with virtualenv?

I’m using python 2.7.6 and create a virtualenv for Pytorch.
And I followed this post http://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs, it worked for Tensorflow.
But when I use it for pytorch with jupyter notebook server, when I run pytorch code, it shows that the kernel has been restarted and the code could not be run.

The error info is:

… …
lib/x86_64-linux-gnu/ld-2.24.so
7f54da8f8000-7f54da9b8000 rw-p 00000000 00:00 0
7f54da9e9000-7f54daaad000 rw-p 00000000 00:00 0
7f54daacc000-7f54daacd000 rw-p 00000000 00:00 0
7f54daacd000-7f54daace000 rwxp 00000000 00:00 0
7f54daace000-7f54daad1000 rw-p 00000000 00:00 0
7f54daad1000-7f54daad2000 r–p 00025000 08:01 34078808 /lib/x86_64-linux-gnu/ld-2.24.so
7f54daad2000-7f54daad3000 rw-p 00026000 08:01 34078808 /lib/x86_64-linux-gnu/ld-2.24.so
7f54daad3000-7f54daad4000 rw-p 00000000 00:00 0
7fffb6a5a000-7fffb6a7b000 rw-p 00000000 00:00 0 [stack]
7fffb6bf7000-7fffb6bf9000 r–p 00000000 00:00 0 [vvar]
7fffb6bf9000-7fffb6bfb000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
[I 14:37:52.843 NotebookApp] KernelRestarter: restarting kernel (1/5)
WARNING:root:kernel f643dbf1-0460-47b3-a91c-aeb392849097 restarted