473,624 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2.5 from source install problem with extensions

Hi!

I am doing a from source installation of Python 2.5 on some old Debian
machine. As the target directoy I want /opt/somename so i added it to
the configure like so:

../configure --prefix=/opt/somedir

The following make works fine as far as I can see. Then the make
install also actually works and installs python in /opt/somedir with
all its subdirectoris (bin, lib, man, include).
The extensions (*.so) however get put in /usr/local/lib/... and there
also in the wrong python directoy: 2.4

This is a c/p of the make install output:
[...]
running build_scripts
running install_lib
changing mode of /usr/local/lib/python2.4/site-packages/_struct.so to
755
changing mode of /usr/local/lib/python2.4/site-packages/_ctypes.so to
755
[...]

(How) can I change the install_dir for the extensions?
Why does it use python2.4 anyway?! What env var or else is set here
that I cannot find?

thanks!

Apr 18 '07 #1
3 1194
On Apr 18, 12:36 pm, Florian Demmer <fdem...@gmail. comwrote:
Hi!

I am doing a from source installation of Python 2.5 on some old Debian
machine. As the target directoy I want /opt/somename so i added it to
the configure like so:

./configure --prefix=/opt/somedir

The following make works fine as far as I can see. Then the make
install also actually works and installs python in /opt/somedir with
all its subdirectoris (bin, lib, man, include).
The extensions (*.so) however get put in /usr/local/lib/... and there
also in the wrong python directoy: 2.4
....and the current /usr/bin/python symlink points to the 2.4
installation (from .deb)
This is a c/p of the make install output:
[...]
running build_scripts
running install_lib
changing mode of /usr/local/lib/python2.4/site-packages/_struct.so to
755
changing mode of /usr/local/lib/python2.4/site-packages/_ctypes.so to
755
[...]

(How) can I change the install_dir for the extensions?
Why does it use python2.4 anyway?! What env var or else is set here
that I cannot find?

thanks!

Apr 18 '07 #2
Hi,

On 2007-04-18, Florian Demmer <fd*****@gmail. comwrote:
On Apr 18, 12:36 pm, Florian Demmer <fdem...@gmail. comwrote:
>Hi!

I am doing a from source installation of Python 2.5 on some old Debian
machine. As the target directoy I want /opt/somename so i added it to
the configure like so:

./configure --prefix=/opt/somedir

The following make works fine as far as I can see. Then the make
install also actually works and installs python in /opt/somedir with
all its subdirectoris (bin, lib, man, include).
The extensions (*.so) however get put in /usr/local/lib/... and there
also in the wrong python directoy: 2.4
Basically I had the same problem(s).
>(How) can I change the install_dir for the extensions?
Why does it use python2.4 anyway?! What env var or else is set here
that I cannot find?
I've patched setup.py as follows:

--- setup.py.orig Thu Aug 10 01:42:18 2006
+++ setup.py Mon Dec 25 19:05:29 2006
@@ -147,6 +147,14 @@
if ext.name in sys.builtin_mod ule_names:
self.extensions .remove(ext)

+ # so -lpython2.5 works in the build
+ ext.library_dir s.append('.')
+
+ # so shared libs requiring libpython2.5.so work
+ py_instdir = os.environ.get( "INSTDIR_PYTHON ", None)
+ if py_instdir:
+ ext.library_dir s.append(os.pat h.join(py_instd ir, 'lib'))
+
if platform != 'mac':
# Parse Modules/Setup and Modules/Setup.local to figure out which
# modules are turned on in the file.
Then you have to add INSTDIR_PYTHON to your shell environment, i.e.

INSTDIR_PYTHON=/opt/somedir ; export INSTDIR_PYTHON

or whatever your shell requires.

This works for me. Hope it helps,

Anton
Apr 18 '07 #3
On Apr 18, 7:39 pm, Anton Hartl <anton.ha...@gm ail.comwrote:
Hi,

On 2007-04-18, Florian Demmer <fdem...@gmail. comwrote:
On Apr 18, 12:36 pm, Florian Demmer <fdem...@gmail. comwrote:
Hi!
I am doing a from source installation of Python 2.5 on some old Debian
machine. As the target directoy I want /opt/somename so i added it to
the configure like so:
./configure --prefix=/opt/somedir
The following make works fine as far as I can see. Then the make
install also actually works and installs python in /opt/somedir with
all its subdirectoris (bin, lib, man, include).
The extensions (*.so) however get put in /usr/local/lib/... and there
also in the wrong python directoy: 2.4

Basically I had the same problem(s).
(How) can I change the install_dir for the extensions?
Why does it use python2.4 anyway?! What env var or else is set here
that I cannot find?

I've patched setup.py as follows:

--- setup.py.orig Thu Aug 10 01:42:18 2006
+++ setup.py Mon Dec 25 19:05:29 2006
@@ -147,6 +147,14 @@
if ext.name in sys.builtin_mod ule_names:
self.extensions .remove(ext)

+ # so -lpython2.5 works in the build
+ ext.library_dir s.append('.')
+
+ # so shared libs requiring libpython2.5.so work
+ py_instdir = os.environ.get( "INSTDIR_PYTHON ", None)
+ if py_instdir:
+ ext.library_dir s.append(os.pat h.join(py_instd ir, 'lib'))
+
if platform != 'mac':
# Parse Modules/Setup and Modules/Setup.local to figure out which
# modules are turned on in the file.

Then you have to add INSTDIR_PYTHON to your shell environment, i.e.

INSTDIR_PYTHON=/opt/somedir ; export INSTDIR_PYTHON

or whatever your shell requires.

This works for me. Hope it helps,
nice workaround (and it does work), thank you...
at least until when i try to install Python2.6 and forget about that
again ;)

since i was not quite satisfied by the solution (i will have to
install py25 from source on a customer's system that i dont know much
about yet at a later time and that _has_ to work then), i searched for
more reasons why it fails in the first place... and actually found
something:

~/.pydistutils.cf g
--install_lib = /usr/local/lib/python2.4/site-packages

.... uncommented it and ran make install again --works! :D

br
Florian

Apr 19 '07 #4

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

Similar topics

0
1871
by: Dan Finn | last post by:
usinng php-4.3.4 using this for my configure script; ../configure --with-pear=/usr/local/lib/pear --with-mysql --with-apxs=/usr/sb in/apxs --enable-track-vars --with-mysql-sock=/tmp/mysql.sock then make; make install output says it installed pear: : make install
188
8395
by: Ilias Lazaridis | last post by:
I'm a newcomer to python: - E01: The Java Failure - May Python Helps? http://groups-beta.google.com/group/comp.lang.python/msg/75f0c5c35374f553 - I've download (as suggested) the python 2.4 installer for windows. Now I have problems to compile python extension that some packages
27
3860
by: Mike | last post by:
Open source programs in general suck pretty bad also. Here are some loose facts regarding why projects like Linux, PHP, MYSQL, and other open source programs suck: - Linux is simply a clone of an operating system over 20 years old similar to DOS (Unix). That's ALL Linux is. The kernal was taken, decompiled, and stolen by Linus himself. That's a fact. Xerox should have sued, but at the during the early 1991, no one was really using Unix...
0
5975
by: Erwin Moller | last post by:
Hi, I am one of those questionable people that started with Vista (Home Premium). Not because I think it is a ready/steady OS, but partly out of curiousity, and partly because I needed to work on an old project that happens to run on IIS6/W2000/MSSQL7, but my W2000 machine couldn't handle the size of the database in question anymore. :-( My new Vista machine is 5 years younger and is a lot faster, so I started to figure out how to use...
0
8233
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
8675
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
8619
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...
0
7158
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...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.