Python configuration question when python scripts are executed using Appweb as web server.

IronyOfLife mydevforums at gmail.com
Thu Aug 6 11:49:30 EDT 2009


Hi Gabriel

On Aug 5, 4:18 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> En Tue, 04 Aug 2009 10:15:24 -0300, IronyOfLife <mydevfor... at gmail.com>
> escribió:
>
> > On Aug 3, 8:42 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> >> En Mon, 03 Aug 2009 11:04:07 -0300, IronyOfLife <mydevfor... at gmail.com>  
> >> escribió:
>
> >> > I have installed python 2.6.2 in windows xp professional machine. I
> >> > have set the following environment variables -- PYTHONPATH. It points
> >> > to following windows folders: python root folder, the lib folder and
> >> > lib-tk folder.
>
> >> Why? Did you read it somewhere? Usually there is no need to set the  
> >> PYTHONPATH variable at all; remove it.
>
> > Setting PYTHONPATH environment variables is mentioned in Python docs.
>
> Could you provide a link please? Setting PYTHONPATH should not be

Here are couple of links that discusses setting PYTHONPATH environment
variable.
http://docs.python.org/using/windows.html
http://www.daimi.au.dk/~chili/PBI/pythonpath.html

> necesary, and in fact it's a very bad idea. Environment variables are
> global, but Python modules may depend on the Python version, architecture,
> install location... By example, you may install a 64 bits Python 3.1
> version *and* a 32 bits Python 2.5 version and they both can coexist
> peacefully - but an extension module compiled for the former cannot be
> used in the later version. You must build a separate library for each
> version, and install them in two separate directories. But since the
> PYTHONPATH variable is shared by all installations, which directory should
> contain?
> It's best not to use PYTHONPATH at all and rely on other alternatives
> (like .pth files, that are searched relative to the current Python
> executable, so different versions use different configuration files)

I understand your concerns regarding setting of PYTHONPATH while
multiple versions of Python are installed on the same machine. My fix
however does not use PYTHONPATH. The GNUTLS wrapper module for PYTHON
loads the GNUTLS dll's and it was not able to find them. Using FileMon
(win tool) I found out the paths that are scanned and I copied the
dlls to one of such paths. I still do not like this fix. This is a
temporary solution.

Can you explain maybe with some sample how to set .pth files? Maybe
this will resolve my issue.
>
> > I solved the issue temporarily by copying the gnutls related dlls to
> > the path searched by python.exe
>
> Glad to see you could finally fix it!
>
> --
> Gabriel Genellina

Thanks very much for your reply.



More information about the Python-list mailing list