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

问题描述

一、问题描述:

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

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

在这里插入图片描述

二、解决方法

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

成功啦!!!!!!!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您遇到的错误是由于使用了vpython库中的sphere类或box类时出现的。具体报错信息是"AttributeError: 'box' object has no attribute 'idx'"(如果使用的是sphere类,则错误信息为"'sphere' object has no attribute 'idx'")。经过调试,发现问题可能出在您的代码中。 另外,您还提到了一个与fitz库相关的错误。具体报错信息是"AttributeError: 'Page' object has no attribute 'MediaBox'"。根据您提供的引用内容,可以看出问题可能是由于使用了错误的方法名导致的。 为了解决这些问题,您可以尝试以下方法: 1. 检查您的代码中是否正确导入了vpython库,并确保正确使用了sphere类或box类。您可以参考vpython库的官方文档或示例代码来确保正确使用这些类。 2. 对于fitz库相关的问题,您可以尝试将错误的方法名"getText"更改为"get_text",以解决"AttributeError: 'Page' object has no attribute 'MediaBox'"的错误。 希望以上方法能够帮助您解决问题。如果问题仍然存在,请提供更多的代码和错误信息,以便我们更好地帮助您解决问题。 #### 引用[.reference_title] - *1* [vpython : AttributeError: ‘boxobject has no attributeidx](https://blog.csdn.net/weixin_43505418/article/details/124807843)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v12^insert_chatgpt"}} ] [.reference_item] - *2* *3* [PyMuPDF 读取pdf时 显示 AttributeError: ‘Page‘ object has no attribute ‘getText‘ 解决方案](https://blog.csdn.net/qq_42495314/article/details/125531386)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v12^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值