Pythonpath问题-Cocos2d
我正在尝试在 python 中使用名为 Cocos2d 的游戏库。但是,我无法真正导入它。它安装在 python 的 lib 目录之一中,当我导入它时,它说它不在那里。我知道它与 pythonpath 有关(我正在使用的 IDE 中提供),但我不确定如何设置它。我尝试将 cocos2d 的文件夹添加到 python 路径,但它似乎不起作用。该文件的名称不是 cocos,同一目录中也没有任何具有该名称的文件。有什么建议吗?
I'm trying to use a game library called Cocos2d in python. However, I can't really import it. It's installed in one of python's lib directories, and when I import it, it's saying that it's not there. I know it has to do with pythonpath (provided in the IDE I'm using) but I'm not sure how to set it up. I've tried just adding the folder with cocos2d to the python path but it doesn't appear to work. The file's name is not cocos nor are there any files in the same directory with said name. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您收到导入错误消息吗?
我不知道你是如何安装它的,但这是我刚刚执行的步骤,并且在这里有效。
python setup.py install
它甚至会自动安装 pyglet。
Do you get an import error message ?
I don't know how you installed it but here are the steps I just did and which are working here.
python setup.py install
It even automatically installs pyglet.