This topic is READ ONLY
CharlieM (1) [Avatar] Offline
#1
I am trying to import easygui and I cannot get it to work. I have read all the posts here and elsewhere about how you have to unzip it into a folder path named /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/. I created that path in my Library folder and I moved the contents of the easygui83 folder into the site-packages directory so that easygui.py is right there in the site-packages folder and I still get the following result:
IDLE 1.2
>>> import easygui

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import easygui
ImportError: No module named easygui
>>>

I have tried multiple times and after an hour of this I am really frustrated. Can anyone help me? (Mac Mini Running Snow Leopard 10.6.1) Thanks!
warren.sande (211) [Avatar] Offline
#2
Re: Import easygui Still not working!
It could be that you have more than one version of Python installed on your computer, and the version you are running is not 2.5.

To see what version you are running, try this:

import sys
print sys.version

That will tell you if you are running 2.5 or some other version that was already installed on your computer.

If you are not running 2.5, then Python won't be looking in the /.../Versions/2.5/ folder for modules, so it won't find Easygui.

If that's not the problem, post again, and we will figure it out.

Regards,
Warren Sande
EG527 (4) [Avatar] Offline
#3
Re: Import easygui Still not working!
Hi,

I'm having the same problem, and have checked that the version is 2.5, and it came up with this:

>>> import sys
>>> print sys.version
2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)]

I'm assuming that the 2.5 means that it is version 2.5

So, do you know what could be wrong?

I definitely put the folder into the site packages folder:

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/easygui83


grateful for any help,
thanks
warren.sande (211) [Avatar] Offline
#4
Re: Import easygui Still not working!
I'm not sure why that's not working. But here's something else you can try:

Wherever you are saving your programs, put a copy of easygui.py there as well.

Then Python will certainly be able to find it (assuming it can find and run your program).

Let us know if that works.


Regards,
Warren Sande
EG527 (4) [Avatar] Offline
#5
Re: Import easygui Still not working!
Thanks, I tried that and it worked, but after some more tinkering I found that the files from the folder easygui83 need to be in the folder site-packages, not within a folder within the folder site-packages.

Thanks for your help
warren.sande (211) [Avatar] Offline
#6
Re: Import easygui Still not working!
Oh, I thought you already knew that. In your first post you said:

"easygui.py is right there in the site-packages folder..."

I'm glad you got it working.


Regards,
Warren Sande
EG527 (4) [Avatar] Offline
#7
Re: Import easygui Still not working!
sorry if i didn't make that clear


thanks
kc.py (1) [Avatar] Offline
#8
Re: Import easygui Still not working!
I am having this identical problem. I followed the replies to this thread and did what they said and it still is not importing easygui.py. Can anyone help please? I too am using a Mac Mini running Snow Leopard 10.6.2.

Thanks
Sean C. (11) [Avatar] Offline
#9
Re: Import easygui Still not working!
Can you find your site-packages directory and post a list of what's in there?
rgb1 (2) [Avatar] Offline
#10
Re: Import easygui Still not working!
Wherever you are saving your programs, put a copy of easygui.py there as well.




That's what I had to do.
I use a Mac OS X Leopard, it was the only option that worked.
Thank you for your help.
reeves6996 (1) [Avatar] Offline
#11
Re: Import easygui Still not working!
I am running mac 10.6.8 and python 2.5,
I made the folders "library/python.framework/versions/2.5/lib/python2.5/site-packages" but still when i put the easygui.py file in the site packages folder. Python still says it doesn't exist.
T126 (1) [Avatar] Offline
#12
Re: Import easygui Still not working!
I put easygui.py on the site-packages folder but when I go onto IDLE and try to import it I get this error message:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import easygui
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/easygui.py", line 1
SyntaxError: Non-ASCII character 'xff' in file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/easygui.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

What should I do?
warren.sande (211) [Avatar] Offline
#13
Re: Import easygui Still not working!
Did you use our installer? I'm guessing not, because the installer for the 1st Edition of the book installs Python 2.5, and you have 2.7.

If you are using the First Edition, try running the First Edition installer.
327840 (1) [Avatar] Offline
#14
Mine is not working either. It says this:

>>> import easygui

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import easygui
File "C:\Python25\easygui.py", line 1
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:0smilie [MSC v.1310 32 bit (Intel)] on win32
^
SyntaxError: invalid syntax