vpython : AttributeError: ‘box‘ object has no attribute ‘idx‘

问题描述

一、问题描述:

导入vpython库之后,使用了vpython库中的sphere类或box类之后报错如下:
vpython : AttributeError: ‘box‘ object has no attribute ‘idx‘_第1张图片
主要报错语句是划线部分:AttributeError: 'box' object has no attribute 'idx'(box换成sphere是一样的)

经过debug,发现具体报错如下:

vpython : AttributeError: ‘box‘ object has no attribute ‘idx‘_第2张图片

二、解决方法

  1. 确定vpython已经安装
  2. 查看该项目环境的第三方库中autobahntxaio这两个包,如我的是:
    autobahn版本是22.4.2, txaio版本是22.2.1。
  3. 降低audobahn 的版本。如我将版本降到22.3.2

成功啦!!!!!!!

你可能感兴趣的:(python疑难杂症,vscode,python)