python path - pdflib

steve steven.smith at level3.com
Thu Nov 8 16:27:29 EST 2001


I am trying to set a program to use a path in python.  I see that I
can set my environment variable PYTHONPATH or set the sys.path in
python to the dir I want.  I am having problems getting python to find
the files I want in this path.

I am using the pdflib to create a pdf file.  I need things that are in
the fonts directory.  If I do a sym-link in the dir I am running my
script from, everything works fine.  When I don't try to open up a
file from a different directory, the fonts are loading correctly. 
When I open a file, then set the font type, it can't find the font,
unless it is in the directory the script is being run from, even
though I do a print sys.path and the directory is the first path
listed.

Has anyone seen this problem or know a fix for it?  I'm somewhat
stumped.  It seems to me that it is a python/sys problem, because why
would the sys module be affected by another module?  Maybe I'm wrong
on this assumption.  As a note, I was using python 2.0 as this is what
pdflib wants to use, but I have tried with 2.1.



More information about the Python-list mailing list