Search code examples
pythonjupyter-notebookanacondajupytervpython

Problems with installing VPython on Jupyter Notebook


I am working on a project on Jupyter Notebook and I need to use VPython for some animations. I have Anaconda and the latest version of Python installed on my laptop. I have downloaded VPython from the command line using "pip install vpython" and I have checked that it is the latest version. (It might be useful to note that initially I had only Anaconda and Jupyter Notebook installed, and to download VPython I had to first download Python itself, then install pip, and finally install VPython). I have also installed the visual build tools and Node.js (but I don't have Jupyter Lab installed so I'm not sure if the latter is useful or not). I have followed all the instructions on https://vpython.org/presentation2018/install.html. Moreover, I have run the command "!pip install vpython" inside the Jupyter Notebook. However, when I try to run the following:

from vpython import *
sphere()

the Jupyter Notebook runs a bit, then stops and does not output anything. I also tried replacing "sphere()" with "box()", but this does not change anything. Same thing happens if I try to import only "sphere" from VPython and then run "sphere()".
I tried to search online and on this website for a solution, but I couldn't find anything. Any help would be very appreciated.
If it can be of any help, my web browser is Google Chrome and two friends of mine who are working on the same project are having the same issues with VPython.

EDIT: I tried running

%pip install vpython

in the Jupyter Notebook and I got some output saying that the requirement is already satisfied and the following comment: "Note: you may need to restart the kernel to use updated packages". I deleted the command "%pip install vpython", restarted the kernel and run the cell, but nothing was outputted.


Solution

  • There seem to be problems with the latest installer. A workaround is to install vpython 7.5.2. A new release is imminent.

    I'll mention that for VPython questions it's better to post to the VPython forum, where there are many more VPython users who will see your question than if you post to stackoverflow:

    https://groups.google.com/forum/?fromgroups&hl=en#!forum/vpython-users