Python 2.1.1 ... stupid error in import.c
Armin_member at newsguy.com
Sun Aug 26 18:57:30 CEST 2001
In article <uvugotgfhdhf7f0fenfeh27bqakbk9127r at 4ax.com>, Tim says...
>Armin Steinhoff <a-steinhoff at web.de> wrote:
>> to all who are porting 2.1.1 to a UNIX like system.
>>I'm porting 2.1.1 to QNX6 and got the situation that the module 'os' could not
>>be be found with 'import os'
>>After some hacking with DDD .. I found out that the pathes used by the search
>>algorithm of import.c has nothing to do with the directory structure of the
>>>>UNIXdistribution of Python 2.1.1 =:-/
>I'm not sure you really understand the normal layout of a Unix directory
>structure. In Unix, you never install a product in the root of a
I didn't install a product. As a root guy ... I have the freedom to install
my stuff everywhere, even if it doesn't fit to your puristic UNIX view :)
>The root is kept as simple as possible: /usr, /home, /etc,
>/var, /boot, /tmp, and little else.
Should be the common rule for productive systems ...
> The various files that make up a
>product get spread around. Binaries go into a global binary directory.
>Libraries go into a global library directory. Configuration files go into
>yet another central directory.
>When you install Python in a Unix-like system, you specify a top-level
>"prefix". This is usually either /usr or /usr/local. The Python binary is
>then installed in $prefix/bin. The modules are installed in
>$prefix/lib/python-2.1 (that is, only the first two digits of the version
>are used to make the library path).
Sorry ... you missing the point. I didn't install the binaries of Python !!
Also, 'make install' didn't install the .so modules to $prefix/lib/python-2.1 .
>>I have installed Python in the root directory and set PYTHONHOME/PYTHONPATH to
>>/Python-2.1.1 -> the path to he library modules is then
>> -> /Python-2.1.1/Lib
>What you describe is the way a Windows installation works.
> This is NOT how a Unix installation usually works.
>>The search algorithm of import.c is using the following search path sequence:
>> "os.so" -> I don't know why it should make sense to open
>> a shared object with fopen ??
>> "/Python-2.1.1/os.so" ... os.pyc
>> "/Python-2.1.1/lib/python2.1/os.so" ... os.pyc
>> ^^^^^^^^^^^^^^^ who got the idea that this is part of the
>> UNIX distribution ??
>Well, that's the way it works.
You are missing the point ... the search algorithm doesn't meet the
directory structure of the source archive of Python-2.1.1!
>- Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
More information about the Python-list