[Pythonmac-SIG] which python pil? Plus Python/Apache question.

Jack Jansen Jack.Jansen at cwi.nl
Fri Jun 6 12:05:55 EDT 2003


On Friday, Jun 6, 2003, at 01:20 Europe/Amsterdam, Calvin wrote:

>>> what I want to know is will it build pil with jpeg
>>> support if I have the jpeg libs installed?
>
>> Yes. If you use Package Manager to install PIL it will install the  
>> jpeg
>> reader. If you install a binary PIL through PackMan this happens
>> automatically (because I built the PIL distribution on a system where
>> libjpeg was available), if you install PIL from source it will work
>> correctly if you've installed libjpeg through fink.
>
> well, I tried doing it through source, and I don't like fink, so I  
> tried
> it the old fashioned way.  it didn't work.

Here's the invocation I used, with libjpeg in /sw, for PIL 1.1.4. You  
should modify it for your location of libjpeg.

% cd libImaging
% LDFLAGS="-L/sw/lib" CPPFLAGS="-I/sw/lib" ./configure
% make JPEGINCLUDE=/sw/include libImaging.a
% cd ..
% python setup.py install

Actually, this is also the command line that Package Manager uses when  
installing PIL from source.

> I can keep fiddling, but how
> install pil with a package manager?  Nothing on the PIL website

Sorry, I should have explained, you've apparently missed the discussion  
on Package Manager here.

Package Manager is a MacPython-specific tool that downloads and  
installs distutils-based Python extension packages. After you've done a  
framework install you'll find it in  
/Applications/MacPython-2.3/PackageManager, or in the "File" menu of  
the IDE. The terms "PackMan" and "pimp", when you see them on this  
list, mean roughly the same.

After a framework build, start the IDE and look at the "MacPython Help"  
in it's help menu. It's only a couple of pages, but it should give you  
an idea of the functionality MacPython adds over unix-Python. And, as  
always, if there's stuff missing or unclear: please report!

>> I haven't done it, but I'm interested. And as you say you've got more
>> questions than answers: if you can try building MySQLdb and give me a
>> recipe I'll add it to the package manager.
>
> hah! well I did do it.  I followed the instructions for mysql install  
> from
> here:
> http://www.entropy.ch/software/macosx/mysql/
>
> here are the basic instructions for MySQLdb:
> 	$ tar xfz MySQL-python-0.9.2.tar.gz
> 	$ cd MySQL-python-0.9.2
> 	$ python setup.py build
> 	$ su
> 	$ python setup.py install
>
> To get it to work I had to make the following changes to setup.py
> modify setup.py:
> 		include_dirs = [
> 		    '/usr/local/mysql/include'
> 		    ]
> 		library_dirs = [
> 		    '/usr/local/mysql/lib'
> 		    ]
> also:
> 		elif sys.platform[:6] == "darwin": # Mac OS X
> 		    include_dirs.append('/usr/local/mysql/include')
> 		    library_dirs.append('/usr/local/mysql/lib')

Thanks! I will look into it. It won't work with PackMan as-is (as this  
does automatic installs I can't really edit setup.py files), but there  
may be a way to beat it into submission.

> and it seems work okay.  it imports anyway...yeah it works just fine.
>
> EXCEPT for through apache!
>
> here is sys.path in Apache:
> ['/Library/WebServer/Documents',
> '//Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip',
> '//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3',
> '//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ 
> plat-darwin',
> '//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ 
> plat-mac',
> '//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ 
> plat-mac/lib-scriptpackages',
> '//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib- 
> tk',
> '//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib- 
> dynload']
>
> No site-packages...which is where MySQLdb lives.  How can I fix this?

Strange... Does anyone else who uses Python from Apache have an idea  
what could be going on here? Maybe it uses a different site.py or  
actively removes site-packages from sys.path?
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma  
Goldman




More information about the Pythonmac-SIG mailing list