简体   繁体   中英

How to use vpython in spyder?

I am trying to use vpython, any way I can, but I'm failing...

First, I installed the Anaconda Python 2.7.10 on Win 8.1. Then, I installed Vpython by typing into the command line: conda install -c https://conda.binstar.org/mwcraig vpython

Then I tried 3 things:

(1) Double-click the "VIDLE for VPython" shortcut on my desktop. Nothing happens. I look at the target, which points to pythonw.exe. I double-click directly on pythonw.exe. Nothing happens.

(2) I notice that there is also python.exe in the same folder, so I double-click on it, and get a command prompt. I type "from visual import *" and it seems to execute without error. Then I type "sphere()" and opens up a gray window titled "vpython" but it just hangs without ever showing me a sphere.

(3) Then I launched spyder, and typed "from visual import *", which seemed to execute without error. Then I typed sphere(), and it spits out the text "visual_common.primitives.sphere at 0x152ccb38" and another gray window pops up with the title "vpython" but it also hangs indefinitely.

How can I debug this situation? Thanks so much! I'd really like to show a simple vpython script in my physics lecture tomorrow...

I know its late, but it might prove useful to others:

To run vpython 7 from an IDE you need to have Python 3.5.3+ installed. Note that for use in Spyder you have to go to Run > Configure and specify "Execute in a new dedicated Python console" ( Vpython doesn't work in spyder 3.2.0). This information can also be found at http://vpython.org/ .

For questions regarding vpython I recommend you ask in the Vpython users google group.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM