Trouble importing simplegui

那年仲夏 提交于 2021-02-19 04:28:05

问题


I installed PyDev in Eclipse to run Python programs, but I’m facing trouble importing simplegui. It is showing me this error:

import simplegui

ImportError: No module named simplegui

My installed PyDev version is 2.7.1.


回答1:


Did you learn Python using CodeSkulptor? simplegui is a custom module for CodeSkulptor, meaning that it is only available in CodeSkulptor.

More information here.




回答2:


You can use SimpleGUICS2Pygame. Just change import simplegui by import SimpleGUICS2Pygame.simpleguics2pygame as simplegui in your CodeSkulptor program and run it in standard Python




回答3:


I am using a Mac, when I installed simplegui off of the Python website, I had to import it as:

import simpleguitk

I also downloaded it through terminal with the command:

sudo pip install SimpleGUITk



回答4:


Simple, download simplegui.zip form http://florian-berger.de/en/software/simplegui.

unzip simplegui-x.x.x.zip
cd simplegui-x.x.x
python setup.py install

Replace x.x.x with version number. You might want to run the last step with sudo rights.



来源:https://stackoverflow.com/questions/13815722/trouble-importing-simplegui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!