472,805 Members | 4,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

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 2040
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Shalen chhabra | last post by:
Hey, Can anyone give me a snippet for running a python program over all the files in the directory. For ex: I have ten files in a directory and I want to run a python program against all of...
20
by: Matthew Thorley | last post by:
My friend sent me an email asking this: > I'm attemtping to decide which scripting language I should master and > was wondering if it's possible to do > these unixy awkish commands in python:...
2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
1
by: Petr Prikryl | last post by:
I did observe the problem when using the -U option on Windows 2000. Seems like some infinite recursion in cp1250.py -- see below. I did not try it with earlier versions of Python. Can this...
3
by: looping | last post by:
Hi, I noticed a big speed improvement in some of my script that use os.walk and I write a small script to check it: import os for path, dirs, files in os.walk('D:\\FILES\\'): pass Results on...
0
by: Yannick | last post by:
Hi, I'm Julien from France, We have recently install a new Web Server for my company The server is composed : - Linux RedHat RHEL4 U4 - Httpd-2.0.52-27.ent - Oracle Database 10.2.0.1
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
24
by: Joe Salmeri | last post by:
I just upgraded from Python 2.4.2 to Python 2.5.1 and have found some unexpected behavior that appears to be a bug in the os.stat module. My OS is Windows XP SP2 + all updates. I have several...
4
by: Markus Dahlbokum | last post by:
Hello, I'm trying to link python statically with qt and pyqt. I've tried this in several ways but never succeeded. At the moment the final make runs without errors but I get import errors when...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.