This topic is READ ONLY
yomto1 (5) [Avatar] Offline
#1
I have a nine year old who is using your book - Hello World and has done well until he got to chapter 6. He keeps getting the below error in SPE each time he tries to run a code:

import easygui
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "Csmilieython25easygui.py", line 3, in <module>
AttributeError: 'module' object has no attribute 'buttonbox'

We tried downloading the program again but the same error message was received. I am not computer savy and needs your help on what to do. My son is excited about learning python and I don't want him to be discouraged by this problem.

Thank you
warren.sande (211) [Avatar] Offline
#2
Re: Problems with GUIs and SPE in Chapter 6
Hi,

Can you post the exact code that he is trying to run? (That's the file that he has open in SPE when he gets the error.) Just reply to this post and paste it in.


Regards,
Warren Sande
yomto1 (5) [Avatar] Offline
#3
Re: Problems with GUIs and SPE in Chapter 6
Thanks for your prompt response! The first issue is that there are about 3 windows in SPE. We are not sure which one to use. He tried to practice the example on page 53 of the "Hello World" book. When he entered "import easygui" in the bottom window and press enter, he got the following:

import easygui
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "Csmilieython25easygui.py", line 3, in <module>
AttributeError: 'module' object has no attribute 'buttonbox'


When we tried using the top right window of SPE, we typed,

import easygui
easygui.msgbox (Hello There!")

we got the below message:

File "Csmilieocuments and settingsOwnerMy Documentshope.py", line 1
import
SyntaxError: invalid syntax
Script terminated.
warren.sande (211) [Avatar] Offline
#4
Re: Problems with GUIs and SPE in Chapter 6
The window at the bottom of SPE can be many things, depending what tab you select. It sounds like you were using the "Shell" tab. The shell doesn't work correctly in all versions of SPE, so we don't use the SPE Shell in the book.

You want to use the top widow, which is the editor. That's where you type in code that you will save to a file. Then you run it by using the menu item "Tools > Run without Arguments."

In the code you attached, there is a typo in the second line. There is no quote at the start of "Hello There!", and there needs to be one. That's what gave you the "syntax error". If you fix that and it still doesn't work, let me know, and we'll figure out what's wrong.

Regards,
Warren Sande
yomto1 (5) [Avatar] Offline
#5
Re: Problems with GUIs and SPE in Chapter 6
In the top window, I typed:

import easygui
easygui.msgbox ("Hello There!")

I still got an error message.

import easygui
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "Csmilieython25easygui.py", line 3, in <module>
AttributeError: 'module' object has no attribute 'buttonbox'
warren.sande (211) [Avatar] Offline
#6
Re: Problems with GUIs and SPE in Chapter 6
Okay. A couple of questions. First, what operating system are you using (MacOS, Windows, etc.)?

Second, can you send me a screen shot of SPE with your code and the error message?

You can send it to cp4khelp@yahoo.com


Warren Sande
yomto1 (5) [Avatar] Offline
#7
Re: Problems with GUIs and SPE in Chapter 6
We use Windows operating syst. I will send the screen shot asap. Thank you.
yomto1 (5) [Avatar] Offline
#8
Re: Problems with GUIs and SPE in Chapter 6
I just sent the screen shot to you. Thank you for your help!
warren.sande (211) [Avatar] Offline
#9
Re: Problems with GUIs and SPE in Chapter 6
Okay, could you send me the file
"csmilieython25site-packageseasygui.py" ?

I want to see what version you have and if there is something wrong with the file.

Thanks,
Warren Sande
sandefan (39) [Avatar] Offline
#10
Re: Problems with GUIs and SPE in Chapter 6
Sorry to intrude, but maybe it helps: I love Geany0.18. I find it much easier, faster and more reliable to use than SPE, both with WindowsXP and Linux-Ubuntu. I keep running all listings and games of the book using Geany smilie

Geany: http://www.geany.org/

Message was edited by:
sandefan
starandtina (1) [Avatar] Offline
#11
Re: Problems with GUIs and SPE in Chapter 6
I have the same problem with you. Have you figured out why? Thanks in advance.
warren.sande (211) [Avatar] Offline
#12
Re: Problems with GUIs and SPE in Chapter 6
We never got to the root cause of the problem. But the other user solved the problem by uninstalling Python (deleting the whole Python25 folder) and re-installing using the book's installer:

You can find the installer here:
http://www.manning.com/sande/Installation_Instructions.html

Regards,
Warren Sande