473,800 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help: Python2.3 & Python2.4 on RHEL4 x86_64

RHEL comes with Python2.3 installed. A program I need to install
requires Python2.4

So I got Python2.4 from source and compiled it up. I configured it
with --prefix=/usr --exec-prefix=/usr and --enable-unicode=ucs4 . I
then make'd it and then make altinstall so that it didn't overwrite
the /usr/bin/Python link to /usr/bin/Python2.3 .

Well, for some reason, the arch dependent files did NOT get placed
properly in /usr/lib64/Python2.4, they instead went to
/usr/lib/Python2.4.

Also, when I tried to load pysqlite:
$ Python2.4
>>from pysqlite2 import test
I get the following traceback:

Traceback (most recent call last):
File "setup.py", line 24, in ?
import glob, os, re, sys
File "/usr/lib64/python2.3/glob.py", line 4, in ?
import fnmatch
File "/usr/lib64/python2.3/fnmatch.py", line 13, in ?
import re
File "/usr/lib64/python2.3/re.py", line 5, in ?
from sre import *
File "/usr/lib64/python2.3/sre.py", line 97, in ?
import sre_compile
File "/usr/lib64/python2.3/sre_compile.py" , line 17, in ?
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
AssertionError: SRE module mismatch

This basically means to me that Python2.4 is loading gloab.py from
/usr/lib64/Python2.3 insead of /usr/lib/Python2.4 (even thought I
wanted to install the related files in /usr/lib64/Python2.4)

Can someome please help!

Respectfully,
Christopher Taylor
Oct 18 '06 #1
15 5557
Christopher Taylor schrieb:
This basically means to me that Python2.4 is loading gloab.py from
/usr/lib64/Python2.3 insead of /usr/lib/Python2.4 (even thought I
wanted to install the related files in /usr/lib64/Python2.4)

Can someome please help!
Can you please report what sys.path is? Do you have PYTHONPATH
set, by any chance? Python shouldn't normally look into the library
of a totally unrelated installation.

Regards,
Martin
Oct 20 '06 #2
Christopher Taylor schrieb:
This basically means to me that Python2.4 is loading gloab.py from
/usr/lib64/Python2.3 insead of /usr/lib/Python2.4 (even thought I
wanted to install the related files in /usr/lib64/Python2.4)

Can someome please help!
Can you please report what sys.path is? Do you have PYTHONPATH
set, by any chance? Python shouldn't normally look into the library
of a totally unrelated installation.

Regards,
Martin
Oct 20 '06 #3
PYTHONPATH was the problem.

I had /usr/lib64/python2.3 included and that's why it was breaking. I
took it out and it works fine now. Unfortunately, it still puts the
lib files in /usr/lib instead of /usr/lib64. I'm assuming all I need
to do is set libdir accordingly and the files will get put in
/usr/lib64. How do I then build the library files for 32bits?

Respectfully,
Christopher Taylor
Oct 23 '06 #4
Christopher Taylor schrieb:
I had /usr/lib64/python2.3 included and that's why it was breaking. I
took it out and it works fine now. Unfortunately, it still puts the
lib files in /usr/lib instead of /usr/lib64. I'm assuming all I need
to do is set libdir accordingly and the files will get put in
/usr/lib64. How do I then build the library files for 32bits?
Can you explain what "then" is? If you set libdir so that all files go
into /usr/lib64, why do want *then* that those library files are built
for 32bits? Shouldn't they be built for 64bits if they go to /usr/lib64?

In any case, you usually select the target architecture by either
selecting the right compiler, or the right compiler flags. Just set
CC to a 32-bit-compiler, and Python should be built as 32-bit binaries.

Regards,
Martin
Oct 23 '06 #5
Ok, so if I need to build the 32bit binaries, I just need to make sure
I pass the right argument through to the compiler then? (I'm trying
to build 32 bit and 64 bit binaries on the same system, but I'll wait
untill I get just the 64bit stuff built first before I tackle that)

Also, I've fooled around with passing --libdir=/usr/lib64 to the
configure script and for whatever reason, the Makefile isn't correctly
written. It always ends up copying the lib files to /usr/lib.

So I thought I'd manually edit the Makefile by editing the makefile on
lines 83 and 87 so they are now:
83: LIBDIR= $(exec_prefix)/lib64
87: SCRIPTDIR= $(prefix)/lib64

then:
make clean
make
make test
make altinstall
cd ..
python2.4

I get the following error message:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback

so then I edited /etc/profile and added
export PYTHONHOME="/usr"

then restarted and I got ride of the "Could not find platform
in/dependent libraries" errors but I still get the " 'import site'
failed " error.

I did a python2.4 -v and below is the output:
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
'import site' failed; traceback:
ImportError: No module named site
*** Now I'm lost ***

Just for sanity sakes I undid the changes to lines 83 & 87 of the make
file, did a "make clean", "make", "make test", "make altinstall",
"python2.4" followed by some goofing around and everything works fine.
So I'm guessing my manual edits of the makefile didn't go well. Any
idea what else I need to change?

Respectfully,
Christopher Taylor
Oct 23 '06 #6
Christopher Taylor schrieb:
Also, I've fooled around with passing --libdir=/usr/lib64 to the
configure script and for whatever reason, the Makefile isn't correctly
written. It always ends up copying the lib files to /usr/lib.
Ah, I see. The reason is pretty simple: Makefile.pre.in has

LIBDIR= $(exec_prefix)/lib

so it seems that LIBDIR isn't configurable.
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback

Just for sanity sakes I undid the changes to lines 83 & 87 of the make
file, did a "make clean", "make", "make test", "make altinstall",
"python2.4" followed by some goofing around and everything works fine.
So I'm guessing my manual edits of the makefile didn't go well. Any
idea what else I need to change?
You will have to debug this (can't do right now); see Modules/getpath.c,
and the definition of PYTHONPATH. It seems this isn't really supported.

Regards,
Martin
Oct 24 '06 #7
Christopher Taylor schrieb:
Also, I've fooled around with passing --libdir=/usr/lib64 to the
configure script and for whatever reason, the Makefile isn't correctly
written. It always ends up copying the lib files to /usr/lib.
Ah, I see. The reason is pretty simple: Makefile.pre.in has

LIBDIR= $(exec_prefix)/lib

so it seems that LIBDIR isn't configurable.
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback

Just for sanity sakes I undid the changes to lines 83 & 87 of the make
file, did a "make clean", "make", "make test", "make altinstall",
"python2.4" followed by some goofing around and everything works fine.
So I'm guessing my manual edits of the makefile didn't go well. Any
idea what else I need to change?
You will have to debug this (can't do right now); see Modules/getpath.c,
and the definition of PYTHONPATH. It seems this isn't really supported.

Regards,
Martin
Oct 24 '06 #8
Ah, I see. The reason is pretty simple: Makefile.pre.in has
>
LIBDIR= $(exec_prefix)/lib

so it seems that LIBDIR isn't configurable.
So you would agree that this is a bug? I'll post on Python-Dev for
further advice. I'd like to fix this for the x86_64 community.

You will have to debug this (can't do right now); see Modules/getpath.c,
and the definition of PYTHONPATH. It seems this isn't really supported.

I'll ask on Python-Dev for more details on how to fix this.

Respectfully,
Christopher Taylor
Oct 24 '06 #9
Christopher Taylor schrieb:
>Ah, I see. The reason is pretty simple: Makefile.pre.in has

LIBDIR= $(exec_prefix)/lib

so it seems that LIBDIR isn't configurable.

So you would agree that this is a bug?
I personally think this is a bug in AMD64-Linux. Libraries should
be stored in /usr/lib, binaries in /usr/bin, etc. If they need
simultaneous installation of 32-bit binaries for compatibility,
they should store them in architecture-specific directories.
I'll post on Python-Dev for
further advice. I'd like to fix this for the x86_64 community.
The x86_64 community has been using Python for a while, and
apparently has solved this problem already. You should try
to find out how they did it.

Regards,
Martin
Oct 24 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1765
by: Jose Vicente Nunez Z | last post by:
Greetings, I wrote a couple of custom dummy extensions in Python (one a pure Python and the other a C) and i managed to compile and install them without a problem: $ make python2 setup.py build running build
1
2658
by: Mathieu Malaterre | last post by:
Hello, I thought this would be easy but I guess I didn't get the distutil feeling. I am trying to write a setup for install my package but I don't understand how to do that. organisation: setup.py /bin/
0
1587
by: oliversl | last post by:
Hi, I have a stock RHEL4 server and not that the imap_open() function no longer works. I have a local pop3 server running dovecot that I use to autenticate with this line: $imap_stream = imap_open("{mailserver:995/pop3/notls/ssl/novalidate-cert}", $username, $password, OP_HALFOPEN);
0
1600
by: Reestit Mutton | last post by:
I'm trying to get the mysqli object-oriented syntax to work in php. I understand that I have to have at least version 5 of php - I've therefore opted for version 5.1.4. The remainder of my setup is as follows php 5.1.4 mysql 4.1.10a-2.RHEL4.1 httpd-2.0.52-12.2.ent Redhat Enterprise Linux 4 To be able to configure and compile the source of php to work with
1
1656
by: google | last post by:
MySQL Server is version 4.1.7 (I know I should upgrade, and I will if that is the problem but it has been working fine for 1.5 years now and only recently has started to have this problem). Server is Linux Redhat Enterprise 4. PHP is 4.4.4. SQL STATEMENT: ============== SELECT * FROM campaign_contact cc LEFT JOIN optins_master co ON cc.cc_cont_id=co.optin_id
2
2731
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW source pro 9. My application heavily uses RW tools through wrapper classes on the top existing RW classes. RW libraries were built using gcc on linux platform and standalong RW examples are working fine. Since the application compilation is moving...
2
2256
by: Eric B. | last post by:
Hi, I appologize if this is slightly OT, but I am really struggling to figure out how to install Python2.4 on RHEL4. To make matters worse, the RHEL4 machine is a 64bit architecture. I search pyvault, but they only have for .i386. Does anyone know where / how I can find Python2.4 for RHEL4 x64? If there is a better place to be asking this question, please let me know,
0
938
by: Luis Speciale | last post by:
Hi u all : I'm trying to build mod_python in Leopard 10.5.4 with a cvs version from http://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk I have $ python Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
2
1191
by: Luis Speciale | last post by:
Hi I'm trying to build mod_pyton on Leopard 10.5.4 on a Mac G5 with this cvs version http://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk with this Python python Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.