在 Python 中导入 WindowProporties 时出错
Error when importing WindowProporties in Python
我用这个命令安装了 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
我用这个命令安装了 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