简体   繁体   English

vPython不导入

[英]vPython does not import

I've installed vPython 7 on my Linux machine running Mint 18.2 64. Using the iPython environment and Python 2.7.12 I receive the following traceback when trying to import visual. 我已经在运行Mint 18.2 64的Linux机器上安装了vPython7。使用iPython环境和Python 2.7.12尝试导入可视文件时收到以下回溯。

In [1]: from visual import *
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-96658a14bb68> in <module>()
----> 1 from visual import *

/usr/lib/python2.7/dist-packages/visual/__init__.pyc in <module>()
    64                                frame, pyramid, ellipsoid, curve, faces, convex, helix,
    65                                points, distant_light, local_light)
---> 66 from visual.ui import display
     67 import materials
     68 

/usr/lib/python2.7/dist-packages/visual/ui.py in <module>()
      1 import cvisual
      2 from primitives import distant_light, local_light
----> 3 import materials
      4 
      5 # Code to provide special initialization for a display object, and overloaded

/usr/lib/python2.7/dist-packages/visual/materials.py in <module>()
    150 texturePath = os.path.split( __file__ )[0] + "/"
    151 data = loadTGA(texturePath+"turbulence3") # the targa file is 512*512*3
--> 152 tx_turb3 = raw_texture( data=reshape(data,(64,64,64,3)), interpolate=True, mipmap=False )
    153 tx_wood = raw_texture( data=loadTGA(texturePath+"wood"), interpolate=True)
    154 

/usr/lib/python2.7/dist-packages/visual/materials.py in __init__(self, **kwargs)
     68         cvisual.texture.__init__(self)
     69         for key, value in kwargs.iteritems():
---> 70             self.__setattr__(key, value)
     71 
     72 class shader_material(cvisual.material):

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I am not sure why the package refuses to import properly. 我不确定为什么包裹拒绝正确进口。 Anyone seen this error before and know the cause? 有人以前见过这个错误,知道原因吗?

VPython looks really out of date. VPython看起来确实过时了。 The repository was last active in 2012, and has a link to another repository which is also deprecated: 存储库的上一个活动时间为2012年,并且具有另一个不推荐使用的存储库的链接:

This incarnation of VPython will not be developed further; VPython的这种形式将不会进一步发展。 see this announcement for an explanation and this history of the development of VPython. 有关此说明和VPython开发的历史,请参见此公告。 Development efforts are now focused on a Jupyter notebook-based version vpython-jupyter and an in-browser version that requires no local installation at all and runs on mobile devices, at glowscript.org. 现在,开发工作集中在基于jupyter笔记本的vpython-jupyter版本和浏览器内部版本,该版本完全不需要本地安装并可以在移动设备上运行,位于glowscript.org。

I'd recommend trying again with the mentioned vpython-jupyter to have the latest and greatest, and work from there. 我建议再次尝试使用上述vpython-jupyter获得最新和最vpython-jupyter ,然后从那里开始工作。

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

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