FW: [Tutor] where does pythonpath go?

BELSEY, Dylan dylan.belsey@baesystems.com
Thu, 15 Aug 2002 13:20:46 +0930


Laney,
	will forward this on to the python tutor list as someone will
undoubtedly be able to help and it keeps everyone informed and learning :)
	Couple of things, though it won't solve your problem.  I'm partial
to leaving the autoexec.bat file alone and usually set these variables using
the ENVIRONMENT tab in System, under Control Panel.  I don't have a '98
machine with me so I can't remember if it is found in the same place.  If it
is then you would want:

Variable: PYTHONPATH
Value:
C:\myprogr~\python22\pilfiles\pil;C:\myprogr~\python22\pilfiles\dlls;C:\mypr
ogr~\python22\pilfiles\samples

or add to the variable the directories where the installer put your files
rather than moving them around.

	The error that you have reported below from the python prompt does
seem to indicate that it cannot locate the module you are trying to import.
Silly question...but have you checked that image.py or image.pyd or
image.dll exists in the directory - just checking all avenues :)
	You can put the directory that it lives in, in PYTHONPATH.

	Alternatively, I could be completely off track and in that case I
hope that I get picked up on it and someone else can solve your
prob.....particularly anyone with PIL experience.
	
		Dylan



-----Original Message-----
From: Laney Mills [mailto:millsl@cofc.edu] 
Sent: Thursday, 15 August 2002 11:58
To: 'BELSEY, Dylan'
Subject: RE: [Tutor] where does pythonpath go?


Hi Dylan,

Thanks a lot for your note.  The PIL installer give no choice.  It says "I 
am putting it in C:\py22 ... .  The only choice is to accept or cancel.

I did put in a pythonpath statement in my autoexec file:

C:\PROGRA~1\NORTON~1\NAVDX.EXE /Startup
SET SOUND=C:\PROGRA~1\CREATIVE\CTSND
SET MIDI=SYNTH:1 MAP:E MODE:0
SET BLASTER=A220 I9 D3 H7 P300 E620 T6

SET PATH=C:\WINDOWS\SYSTEM;%PATH%
set 
pythonpath=C:\myprogr~\python22\pilfiles\pil;C:\myprogr~\python22\pilfil  
es\dlls;C:\myprogr~\python22\pilfiles\samples

When I ran the autoexec file, it say I was out of envonment space.  Here it 
is


Scanning Memory... OK
Scanning Master Boot Records... OK
Scanning Boot Record... OK
Scanning files... DONE

C:\>SET SOUND=C:\PROGRA~1\CREATIVE\CTSND

C:\>SET MIDI=SYNTH:1 MAP:E MODE:0

C:\>SET BLASTER=A220 I9 D3 H7 P300 E620 T6

C:\>
C:\>SET 
PATH=C:\WINDOWS\SYSTEM;C:\WINDOWS\SYSTEM;C:\WINDOWS;C:\WINDOWS\COMMAND
Out of environment space

C:\>set pythonpath=C:\myprogr~\python22\pilfiles\pil;C:\myprogr~\python2  
2\pilfil
es\dlls;C:\myprogr~\python22\pilfiles\samples

C:\>and it still does this:

Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE Fork 0.8 -- press F1 for help
>>> import image
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in ?
    import image
ImportError: No module named image
>>>

I guess I need to say I now have the pil directory and the samples 
directory drug directly into my main python22 directory.  There were only 
two files in the pil dlls directory.  I just drug them into the python dlls 
directory.

Thanks for your time.  I appreciate your help.  I can't think of a single 
unusual feature of my system that would lead to all this.  You can see that 
my path statement proper isn't very big.

Thanks,
Laney

-----Original Message-----
From:	BELSEY, Dylan [SMTP:dylan.belsey@baesystems.com]
Sent:	Wednesday, August 14, 2002 9:27 PM
To:	'millsl@cofc.edu'; 'tutor@python.org'
Subject:	RE: [Tutor] where does pythonpath go?

Hi Laney,
	Not sure if this helps but you may want to remove PIL and re-install
it in C:\MyPrograms\Python22 ie. where your Python installation lives.  I
had to do this when installing Pmw (Python Mega Widgets for Tkinter).
Haven't tried the Pil so not a guaranteed fix but I suppose it's worth a 
try
if nothing else works.
	Perhaps you might want to post the error, on this list, that you get
when you try to import the functions etc.  It may yield more information as
to the problem. It may come down to adding to PYTHONPATH????

		Dylan


-----Original Message-----
From: Laney Mills [mailto:millsl@cofc.edu]
Sent: Wednesday, 14 August 2002 21:17
To: 'tutor@python.org'
Subject: [Tutor] where does pythonpath go?


I'm running Python 2.2 on a Windows 98se system.  I just downloaded the pil 

thing (what is it called, a library?), but, of course, the Python2.2
couldn't find it.  The install program put it in C:\py22.  My python
installation is in c:\my programs\python22.

I drug the three files in the distribution:  pil, dlls, and samples into my 

python22 directory under the filename pil:  ex:

C:\program files\python22\pil\{dlls, pil, samples}


Still the python couldn't find it.

I checked vis

sys
sys.path

and the pil stuff isn't there, so of course, I need to put it there
somehow.

Incidentally,  I had no difficulty like this at all with the visual
library.  I installer found the python22 directory and put the visual stuff 

in a subdirectory and python found it with no trouble.

This experience is surely one that everyone using pil on a windows system
would run into, yet as far as I can tell, the entire python documentation
system takes the point of view that there is no such problem.

frustration

Thanks in advance.  Laney Mills

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor