简体   繁体   English

如何在spyder中使用vpython?

[英]How to use vpython in spyder?

I am trying to use vpython, any way I can, but I'm failing... 我正在尝试以任何方式使用vpython,但是失败了...

First, I installed the Anaconda Python 2.7.10 on Win 8.1. 首先,我在Win 8.1上安装了Anaconda Python 2.7.10。 Then, I installed Vpython by typing into the command line: conda install -c https://conda.binstar.org/mwcraig vpython 然后,通过在命令行中键入内容来安装Vpython: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. (1)双击桌面上的“ VIDLE for VPython”快捷方式。 Nothing happens. 什么都没发生。 I look at the target, which points to pythonw.exe. 我看着目标,它指向pythonw.exe。 I double-click directly on pythonw.exe. 我直接双击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. (2)我注意到同一文件夹中也有python.exe,因此我双击它,并得到命令提示符。 I type "from visual import *" and it seems to execute without error. 我键入“ from visual import *”,它似乎没有错误地执行。 Then I type "sphere()" and opens up a gray window titled "vpython" but it just hangs without ever showing me a sphere. 然后,我键入“ sphere()”并打开一个标题为“ vpython”的灰色窗口,但它只是挂起而没有向我展示一个球体。

(3) Then I launched spyder, and typed "from visual import *", which seemed to execute without error. (3)然后,我启动了spyder,并键入了“ from visual import *”,该命令似乎没有错误地执行。 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. 然后,我输入sphere(),它弹出文本“ visual_common.primitives.sphere at 0x152ccb38”,另一个灰色窗口弹出,标题为“ vpython”,但它也无限期地挂起。

How can I debug this situation? 如何调试这种情况? Thanks so much! 非常感谢! I'd really like to show a simple vpython script in my physics lecture tomorrow... 我真的很想在明天的物理讲座中展示一个简单的vpython脚本...

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. 要从IDE运行vpython 7,您需要安装Python 3.5.3+。 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). 请注意,要在Spyder中使用,必须转到“运行”>“配置”并指定“在新的专用Python控制台中执行”(Vpython在spyder 3.2.0中不起作用)。 This information can also be found at http://vpython.org/ . 此信息也可以在http://vpython.org/上找到。

For questions regarding vpython I recommend you ask in the Vpython users google group. 对于有关vpython的问题,我建议您在Vpython用户google组中询问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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