469,917 Members | 1,746 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

Build error Python 2.4.1 - stat problem?

Hello,

I tried to build Python 2.4.1 on a Reliant Unix system. Just after the
python executable program has been built, I get the following error:

==== begin make output ===
CC -W1 -Blargedynsym -o python \
Modules/python.o \
libpython2.4.a -lresolv -lsocket -lnsl -ldl
-lm
case $MAKEFLAGS in \
*-s*) CC='cc' LDSHARED='ld' OPT='-DNDEBUG -O' ./python -E
../setup.py -q build;; \
*) CC='cc' LDSHARED='ld' OPT='-DNDEBUG -O' ./python -E
../setup.py build;; \
esac
Traceback (most recent call last):
File "./setup.py", line 1088, in ?
class PyBuildInstallLib(install_lib):
File "./setup.py", line 1094, in PyBuildInstallLib
so_ext = sysconfig.get_config_var("SO")
File "/build_dir/Python-2.4.1/Lib/distutils/sysconfig.py", line 511,
in get_config_var
return get_config_vars().get(name)
File "/build_dir/Python-2.4.1/Lib/distutils/sysconfig.py", line 488,
in get_config_vars
func()
File "/build_dir/Python-2.4.1/Lib/distutils/sysconfig.py", line 358,
in _init_posix
raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation:
unable to open /usr/local/lib/python2.4/config/Makefile (No such file or
directory)
make: *** Error code 1

make: Fatal error.
==== end make output ===

It is strange that the Makefile complains about /usr/local/lib/python2.4
since this is still the build phase, far away from the installation into
/usr/local.
I used the python executable from the build directory to run the
following program:

import os

def main():
if not (os.path.exists("/")):
print "/ does not exist"
else:
print "/ exists"
if not (os.path.isdir("/")):
print "/ is not a directory"
else:
print "/ ok"

if __name__ == "__main__":
main()

The output is:

/ exists
/ is not a directory

It's the same for every (existing) directory name I try: os.path.isdir()
always returns false.

It looks as if the stat results are not recognised: os.path.exists()
works, but all the functions os.path.isdir(), os.path.isfile() etc.
don't.

Could anyone help me to solve the problem?

- Servatius

------------------------------------------------------------------------
Servatius Brandt Phone: +49 89 636-41504
Fujitsu Siemens Computers Fax: +49 89 636-48716
EP SW AD C++ Email: Se**************@fujitsu-siemens.com
Jul 19 '05 #1
1 1908
In article <ma*************************************@python.or g>,
<Se**************@fujitsu-siemens.com> wrote:
....
I used the python executable from the build directory to run the
following program:

import os

def main():
if not (os.path.exists("/")):
print "/ does not exist"
else:
print "/ exists"
if not (os.path.isdir("/")):
print "/ is not a directory"
else:
print "/ ok"

if name == " main ":
main()

The output is:

/ exists
/ is not a directory

It's the same for every (existing) directory name I try: os.path.isdir()
always returns false.

It looks as if the stat results are not recognised: os.path.exists()
works, but all the functions os.path.isdir(), os.path.isfile() etc.
don't.

Could anyone help me to solve the problem?


Unless there are other Reliant users here ahead of you, some
of it is going to be up to you. If you follow isdir() back,
you'll find some hard-coded octal bitmask definitions, including
S_IFDIR = 0040000.

Check it out. Try to use that value the way they're using it,
in C and in Python, and print out all the values involved.
At worst, if C comes out wrong too, you may have a question
that the vendor will be more likely to respond to.

Donn Cave, do**@u.washington.edu
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Matthew Thorley | last post: by
3 posts views Thread by looping | last post: by
13 posts views Thread by 7stud | last post: by
24 posts views Thread by Joe Salmeri | last post: by
4 posts views Thread by Markus Dahlbokum | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.