简体   繁体   English

需要帮助使VPython在Atom上运行

[英]Need help getting VPython to work on Atom

Recently started using the code editor Atom for my Python code. 最近开始为我的Python代码使用代码编辑器Atom。 I've been able to get pretty much everything I need to work, except VPython. 除了VPython之外,我已经能够获得工作所需的几乎所有东西。 I've been told that VPython is supported/compatible with Atom, yet it doesn't work. 有人告诉我Atom支持/兼容VPython,但是它不起作用。

The main issue is that I'm unable to import the 'visual' module. 主要问题是我无法导入“可视”模块。 I've even tried suggested alternatives such as importing 'VPython' or 'vis', and even uninstalled/reinstalled VPython several times in different ways. 我什至尝试了建议的替代方案,例如导入“ VPython”或“ vis”,甚至以不同的方式多次卸载/重新安装了VPython。

Any advice would be highly appreciated. 任何建议将不胜感激。

Check out the Hydrogen package in Atom: https://atom.io/packages/Hydrogen 在Atom中检出氢气包: https//atom.io/packages/Hydrogen

Run code and get results inline using Jupyter kernels like IPython, IJulia, and iTorch. 使用Jupyter内核(如IPython,IJulia和iTorch)运行代码并内联获取结果。 It's one of the coolest packages in Atom as it supports inline plot visualizations if that's what you're looking for. 它是Atom中最酷的程序包之一,因为它正是您所需要的,因此支持嵌入式绘图可视化。

I hope this helps. 我希望这有帮助。

The visual module is part of "classic vpython" which only runs on python 2.7 . 视觉模块是仅在python 2.7上运行的“经典vpython”的一部分。 If you are using python 3.5.3 or higher then you will need the new VPython 7.x package which is probably what you installed if you followed the instructions at vpython.org . 如果您使用的是python 3.5.3或更高版本,则将需要新的VPython 7.x软件包,如果您按照vpython.org上的说明进行安装,则可能是该软件包。 Try running this two lines vpython code. 尝试运行这两行vpython代码。

from vpython import * 从vpython import *

box() 框()

If you run these two lines of code you should see a 3D box appear in a webgl canvas in your webbrowser. 如果运行这两行代码,您应该会在Web浏览器的webgl画布中看到一个3D框。 To write a vpython program use the new syntax and not the old "classic vpython" syntax. 要编写vpython程序,请使用新语法而不是旧的“经典vpython”语法。

http://www.glowscript.org/docs/VPythonDocs/index.html http://www.glowscript.org/docs/VPythonDocs/index.html

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

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