Jupyter VPython kernel keeps dying

335 views
Skip to first unread message

Rajat Sirohi

unread,
Sep 24, 2016, 3:05:09 PM9/24/16
to VPython-users
Hello all,
I am new to this group so please inform me of any mistakes I may make. I am also quite new to python and linux but I have recently tried to install VPython on my linux machine. I have successfully done this on my host OS (Windows 7), but I am having trouble on my Scientific Linux 7.2 VM. I first installed Anaconda3, which works fine. Then in terminal I ran, "pip install vpython". This seems to have successfully installed VPython to my "site-packages" folder in Anaconda3. When I run a jupyter notebook and choose the VPython kernel, it fails to connect and dies. It gives me the error message, "The kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened."

I am not sure if this is relevant, but I also installed ivisual via "pip install ivisual" in hopes of fixing it, but then later uninstalled it, perhaps this has affected it. I have also done the standard "conda install -c vpython vpython" in another effort of fixing the problem, but to no avail.

Please respond if anyone may have an idea as to what is causing this problem because it worked fine on Windows but not on my linux VM. Thank you.

Rajat Sirohi

unread,
Sep 24, 2016, 3:37:43 PM9/24/16
to VPython-users
I managed to fix this on my own. For anyone who may have been experiencing the same problem here is what worked for me:

1. Follow the steps for using VPython with conda, at vpython.org, I will list them here as well
2. Install classic vpython via "conda install -c vpython vpython"
3. Create an environment to run vpython in via, "conda create -c vpython -n vpython_jup_env vpython python" (This creates an environment with name "vpython_jup_env")
4. Activate this environment via "source activate vpython_jup_env" (or simply activate vpython_jup_env on Windows)
5. Open a jupyter notebook via "jupyter notebook" in terminal
6. Create a new notebook and choose "Python [conda env:vpython_jup_env]"
7. From here you should be able to use vpython via "from vpython import *"

Hopefully this helps anyone else who may have had a similar problem.

*As a side note, I realize it may seem as if I was hasty to post to this group without first trying on my own, but I in fact was working to fix this for more than a week and coincidentally happened to fix it right after.

Bruce Sherwood

unread,
Sep 24, 2016, 5:09:17 PM9/24/16
to VPython-users
Thanks much for the report. I can't quite imagine how you managed to find this particular scheme, nor why the normal procedure failed.

In your point "2" you say "Install classic vpython" but in fact Classic VPython is the name we give to the old version that used CPU-based OpenGL, whereas what you installed we're calling Jupyter VPython, which uses the GlowScript GPU/WebGL-based library.

It's not clear whether the Python [conda env:vpython_jup_env] notebook invokes the vpnotebook module that executes

from __future__ import division, print_function
from math import *

These statements make programs run the same on Python 2 or Python 3, and importing all the math functions makes the default math aspect of Jupyter VPython be the same as Classic VPython and GlowScript VPython.
Reply all
Reply to author
Forward
0 new messages