python - 在 Python 中导入 WindowProporties 时出错
问题描述
我用这个命令安装了 Panda3D:
pip3 install panda3d==1.10.6
然后我制作了main .py:
from direct.showbase.ShowBase import ShowBase
from panda3d.core import WindowProporties
class Game(ShowBase):
def __init__(self):
ShowBase.__init__(self)
self.Proporties = WindowProporties
self.Proporties.setSize(500, 500)
self.win.requestProperties(properties)
if __name__ == "__main__": Game = Game()
当我运行此代码时,它会给出错误:
python3 __main__.py
错误:
Traceback (most recent call last):
File "__main__.py", line 2, in <module>
from panda3d.core import WindowProporties
ImportError: cannot import name 'WindowProporties' from 'panda3d.core' (/home/kali/.local/lib/python3.8/site-packages/panda3d/core.cpython-38-x86_64-linux-gnu.so)
我在用:
- Kali Linux 直播
- Python 3.8.2
提前感谢大家
解决方案
好像你的导入有错字,试试这个:
from panda3d.core import WindowProperties
推荐阅读
- spring - Spring Security 具有不同用户详细信息的多个 HTTPSecurity 服务在 Spring Boot 中不起作用
- c - Can-bus 滤波器和屏蔽逻辑
- c# - 邮件在服务器中发送时在本地和危险邮件中发送良好
- ios - Views do not update inside the ForEach in SwiftUI
- swift4 - I want to set a view controller as initial view controller
- android - 如何增加位图的像素大小
- sql - ORACLE - Interval between dates line by line
- javascript - 生成以下结果的更好算法是什么?
- c++ - Why doesn't Visual Studio 2019 compile my code?
- database - 如何删除“Strapi”中具有特定值的条目?