Hello all, I just bought a book on Python, and started to go through it (bought it for my children and myself). I'm having a problem importing 'easygui'. I am new to programming. I am trying to program on my Mac.

I downloaded easygui to the following:/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/

When I go in Finder, I see a easygui83 file, that has the easygui in it.

When I type: import easygui in IDLE I get the following messages:

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

What am I doing wrong? Is the easygui file in the wrong place?

According to easygui's doc, you need a file easygui.py in your site-packages directory.
Note also that the doc says that using easygui with idle may lead to unpredictable results because idle is already a tkinter application.

easygui.py is in the easygui83 folder, which is in site packages. I also tried to import easygui when using SPE and it still told me no module named easygui or easgui83.

you should move easygui.py to site-packages. Is it the only file in the folder ?

Yeah, I did that about 10 minutes ago and it worked. I wish I found you about 15 hours ago. It would have saved me a lot of stress, and the big headache.

Thanks a lot for all your help. I truly appreciate it.

Yeah, I did that about 10 minutes ago and it worked. I wish I found you about 15 hours ago. It would have saved me a lot of stress, and the big headache.

Thanks a lot for all your help. I truly appreciate it.

My computer (mac osx) will not let me put it in site-packages. Any advice?
thanks.

My computer (mac osx) will not let me put it in site-packages. Any advice?
thanks.

I don't use mac os X, but if it does not let you put it in the site-packages directory, it's probably because you don't have superuser privileges. You could probably use the sudo command like in linux to obtain root privileges.
Another way to do it is to put the file in a user specific site-packages directory. On my linux system I have directories $HOME/.local/lib/python2.6/site-packages and the same with python3.1.
If all this fails, there are other ways using the PYTHONPATH environment variable, but try what I said above first.

Edited 6 Years Ago by Gribouillis: n/a

I just found out that my 'site packages' is actually a saved search query and not a real folder. So I picked through my entire hard drive for a folder called site-packages directory and it wasn't there... So I called my instructor for the python course I'm taking and she sent me a email with a file folder attached to it that I need to 'unzip'. I don't really know much about the whole 'zipping' thing but I grasp it well enough (she explained it to me). I opened the folder and it was a bunch of symbols and stuff kind of like the accent marks over words in foreign languages. It was a .zip but it didn't act like one...So I'll try what you said- Thanks so much!!!:):)

If you want to know where the site-packages directory is, you can do this in a python console

>>> import sys
>>> print([x for x in sys.path if x.endswith('site-packages')])

It should list all the site-packages directories currently used by your version of python.

Edited 6 Years Ago by Gribouillis: n/a

Thank you SO MUCH!! I was just about to just give up--- easygui's are so fun now that I can actually use them!:icon_smile:

This question has already been answered. Start a new discussion instead.