[Tutor] easygui question, again
jped.aru at gmail.com
Mon Jun 11 17:21:10 CEST 2007
Where did you get this easygui thing you are trying to install. Is it
the thing that says Compiled Python File? If so I have it. I've
kinda been following your little chat here about it. I want to see if
I could do it.
On 6/11/07, Kent Johnson <kent37 at tds.net> wrote:
> Alan Gauld wrote:
> > "Rafael Bejarano" <bejarar at sbcglobal.net> wrote
> >> that it would be a relatively simple matter to import the easygui
> >> module and call its functions using the terminal window, especially
> >> given that I have had success in the past importing other modules
> >> and
> >> calling their functions.
> > I suspect that this is because you have been using
> > the standard library modules which Python knows how to find.
> > When you add a downloaded module, like easygui, you need
> > to let Python know how to find it. This is done in one of
> > three ways:
> > 1) Put it in the same folder from which you run python
> > 2) Put it in <PYTHON>/lib/site-packages
> > 3) Put in in some other folder and add that folder to
> > your PYTHONPATH environment variable setting
> > The easiest way for you is probably number 2.
> > Try following this procedure:
> > 1) Start Python to get a >>> prompt
> Which means,
> 1a) Open Terminal
> 1b) type python and press return
> > 2) import sys
> > 3) print sys.path
> > 4) use the mouse to select one of the lines that contains
> > "site-packages"
> It won't be a line, it will be a long list. Depending on how your Python
> is installed site-packages will be at a location like
> > 5) Open a Finder window
> > 6) Navigate in Finder to the folder highlighted in your Python window
> > 7) If necessary navigate back up to site-packages itself
> > 8) Create a new sub folder and name it EasyGui
> > 9) Copy easygui.py into the new folder
> > 10) Create a new text file called EasyGui.pth
> > 11) enter the single line "EasyGui" (without the quotes) and save/exit
> > the editor
> This will work but instead of 8-11 I would just copy easygui.py into
> > 12) exit python and enter it again.
> > 13) type import easygui at the Python prompt.
> > If no error messages appear you should have installed easygui
> > where python can see it.
> > NB I typed that at my PC so its from memory and untested but
> > hopefully its close enough that you can figure out any discrepancies.
> > HTH,
> Tutor maillist - Tutor at python.org
More information about the Tutor