[英]VPython acts weird when used with python installation and won't shut down nicely
I want to build physics simulations using VPython.我想使用 VPython 构建物理模拟。 Although, VPython works great on websites like trinket.io, I'd like to use a nicer IDE than the web one, and I'd like to use real python modules as well as external libraries like numpy.
尽管 VPython 在像 trinket.io 这样的网站上运行良好,但我想使用比 Web 更好的 IDE,并且我想使用真正的 Python 模块以及像 numpy 这样的外部库。
I followed the instructions at https://vpython.org/presentation2018/install.html to install VPython locally.我按照https://vpython.org/presentation2018/install.html上的说明在本地安装 VPython。 I used the command
pip install vpython
(not really a fan of conda
) and wrote this simple demo program:我用命令
pip install vpython
(不是真正的粉丝conda
),并写了这个简单的演示程序:
from vpython import sphere
sphere()
When I ran this from the command line, the program indeed worked: a browser window opened displaying the sphere.当我从命令行运行此程序时,该程序确实有效:打开了一个显示球体的浏览器窗口。 However, there are several issues with this setup:
但是,这种设置有几个问题:
RuntimeError: can't register atexit after shutdown
.RuntimeError: can't register atexit after shutdown
。 However, it still seems to run fine.Ctrl+C
also doesn't do anything useful.Ctrl+C
也没有任何用处。 The only way to stop it is to use Ctrl+Break
, which is a really dirty way, in my opinion.Ctrl+Break
,在我看来,这是一种非常肮脏的方式。 I tried to use stop_server
as documented in that link, but no result.stop_server
,但没有结果。 Is there a way to fix these issues or maybe a different environment that will answer my needs?有没有办法解决这些问题,或者可能有一个不同的环境来满足我的需求? I really want to be able to use built-in python modules and external libraries like numpy but it seems impossible at the moment.
我真的很想能够使用内置的 python 模块和像 numpy 这样的外部库,但目前似乎不可能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.