Hi,
I have installed on my Debian GNU/Linux testing/sid
python3-easygui
python3.2
I'm trying to follow tutorial from here:
http://easygui.sourceforge.net/tutorial/index.html#contents_item_2
When I'm trying to run the easygui.py with
python easygui.py
in an xterm window I get the following error:
Traceback (most recent call last):
File "easygui.py", line 1, in <module>
import easygui as eg
File "/debian-adatok-1/Programozas/Python/Emacsszal/easygui.py", line 5, in <module>
eg.msgbox("Hello, world!")
AttributeError: 'module' object has no attribute 'msgbox'
How can I solve this problem?
Regards from Pál
It looks like you saved the tutorial code from
http://easygui.sourceforge.net/tutorial/index.html#contents_item_2
into a file named easygui.py.
So when your script tries to import easygui, it ends up trying (unsuccessfully of course) to import itself.
The solution is to rename your file -- I suggest renaming it to something like test1.py -- and then executing it this way.
>> python test1.py
-- Steve Ferg
Thanks for your feedback on EasyGui.
-- Steve Ferg
http://www.ferg.org/contact_info
I solved this problem by installing into my system the 'python-easygui' debian package from the debian repository.
However on my system I have installed:
python2.6
python2.7
python3
python3-easygui
python-easygui
etc.
When I run 'python' command in an xterm windov the I actually use:
ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 júl 27 00:28 /usr/bin/python -> python2.7
python2.7 and not python3.
So by installing the python-easygui package I satisfy the dependency for python2.7.
Regards from Pál