[Pythonmac-SIG] How to import libraries on Mac OS X?

Eric Wichterich eric at wichterich.net
Thu Oct 23 05:07:07 EDT 2003


Hello Pythonistas,

I've written a Python library with some functions I want to use with 
other Python scripts.
The library is located at (Mac OS X):
/Users/username/Sites/projectname/cgi-bin/name_of_library.py
(My scripts are located in this directory, too.)

I use the statement:  "from name_of_library import special_function" to 
import this special_function.

When I launch the Apache-Server and call a script which wants to import 
this library, I get a "malformed header" error.

But importing standard libraries, such as "from string import *", no 
error occurs.

Maybe some environment variables must be set. But which? Any ideas?

Thank you,
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 709 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20031023/a0b2b1e4/attachment.bin


More information about the Pythonmac-SIG mailing list