Using VPython in Spyder

2,639 views
Skip to first unread message

Bruce Sherwood

unread,
Jul 27, 2017, 10:05:59 AM7/27/17
to VPython-users
Spyder is a good alternative to IDLE for running VPython 7. As is stated at vpython.orgYou can start Spyder from a command prompt by typing "spyder", but you also have to go to Run > Configure and specify "Execute in a new dedicated Python console".

However, new versions of Spyder won't include the option to use "a new dedicated Python console" and for that reason will not be usable to work with VPython programs. I'm not sure, but I think that VPython 7 won't run from the new Spyder 3.2.0.

The basic issue is that the check I use to detect whether you're running in a Jupyter notebook or not fails in the Spyder environment. The Spyder developers (which include VPython fans) have said that they intend to address the VPython problem in Spyder 3.2.1.


Irfan Habib

unread,
Aug 16, 2017, 9:29:57 AM8/16/17
to VPython-users
Hi Bruce

I am using spyder 3.2.1 but am still struggling to run vpython. I can select the "run in dedicated console option" but am not sure what to do from there. Can you please advise?

Best
Irfan

Bruce Sherwood

unread,
Aug 16, 2017, 12:15:01 PM8/16/17
to VPython-users
Although the spyder developers hoped to deal with the issue in 3.2.1, that hasn't happened. One option is to uninstall spyder 3.2.1 and install spyder 3.1.4. Another option is to use IDLE or Jupyter notebook.

Bruce

John

unread,
Aug 16, 2017, 5:26:28 PM8/16/17
to VPython-users
Another option for spyder 3.2.1 is to try the new spyder-notebook plugin and run vpython in the spyder-notebook. Try

pip install spyder-notebook

then launch spyder and click on the notebook tab at the bottom of the spyder display.

If everything is installed OK with spyder-notebook then you should see the notebook screen appear in spyder.

Type some vpython code in the spyder-notebook cell and run the cell. For instance, try run this vpython code.

from vpython import *
box()

You should see a box appear on the screen.

To find out more about spyder-notebook plugin watch this video starting at the 3:45 minute mark.


John
Reply all
Reply to author
Forward
0 new messages