473,395 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Relocatable binary installs....

Hello all,

I'm currently working on a software package that is going to be
distributed in binary form (with accompanying source) for lot of
different unixes (Linux, AIX, HP-UX and others). Parts of the package
are written in Python... so we are going to want to distribute our own
version of python.

Right now we are just distributing the Python tarball and building it
at install time. This works ok, but we are running into some problems
on some machines with weird default installs (DEC Alphas in
particular).... some of them won't build all the python modules we want
(although our in house machines will).

What I want to do is compile python statically into binaries and then
plop them wherever our customers choose to do an install (we will
provide the source tarballs on a cd as well). The problem we are
running into is that when we do this python continues to think it's
still installed where it was initially compiled and not where it has
been placed (which causes some problems with traceback and some other
functions).

Is there a way to make a relocateable python binary... that is... a
python installation that won't care where it is on the machine... and
won't care if it gets put somewhere else besides / ?

Sorry for the long winded post... just want to make sure you understand
my problem.

Thanks in advance for any help!

Derek

Jul 18 '05 #1
6 1690
fr******@gmail.com wrote:
Is there a way to make a relocateable python binary... that is... a
python installation that won't care where it is on the machine... and
won't care if it gets put somewhere else besides / ?


the standard CPython interpreter is 100% "relocatable". If you think
it isn't, you have to be a bit more specific.

</F>

Jul 18 '05 #2
Fredrik Lundh wrote:
fr******@gmail.com wrote:

Is there a way to make a relocateable python binary... that is... a
python installation that won't care where it is on the machine... and
won't care if it gets put somewhere else besides / ?

the standard CPython interpreter is 100% "relocatable". If you think
it isn't, you have to be a bit more specific.

Is it possible that you are using "relocatable" in the standard sense of
"code can be located anywhere in physical memory", where the OP is using
the same term to mean "can live anywhere in the filestore"?

I suspect the problem the OP is seeing is because the --prefix
configuration parameter will cause an interpreter to look in a specific
place for standard libraries. Clearly if you "relocate" the libraries to
another directory entirely then an interpreter without any further nouse
(and no symbolic links to help it) is going to crap out badly.

But I could be wrong.

always-prepared-to-at-least-admit-the-possibility-ly y'rs - steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
Jul 18 '05 #3
Fredrik Lundh wrote:
fr******@gmail.com wrote:

Is there a way to make a relocateable python binary... that is... a
python installation that won't care where it is on the machine... and
won't care if it gets put somewhere else besides / ?

the standard CPython interpreter is 100% "relocatable". If you think
it isn't, you have to be a bit more specific.

Is it possible that you are using "relocatable" in the standard sense of
"code can be located anywhere in physical memory", where the OP is using
the same term to mean "can live anywhere in the filestore"?

I suspect the problem the OP is seeing is because the --prefix
configuration parameter will cause an interpreter to look in a specific
place for standard libraries. Clearly if you "relocate" the libraries to
another directory entirely then an interpreter without any further nouse
(and no symbolic links to help it) is going to crap out badly.

But I could be wrong.

always-prepared-to-at-least-admit-the-possibility-ly y'rs - steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119

Jul 18 '05 #4
Steve Holden wrote:
Is there a way to make a relocateable python binary... that is... a
python installation that won't care where it is on the machine... and
won't care if it gets put somewhere else besides / ?

the standard CPython interpreter is 100% "relocatable". If you think
it isn't, you have to be a bit more specific.

Is it possible that you are using "relocatable" in the standard sense of "code can be located
anywhere in physical memory", where the OP is using the same term to mean "can live anywhere in
the filestore"?


nope.
I suspect the problem the OP is seeing is because the --prefix configuration parameter will cause
an interpreter to look in a specific place for standard libraries. Clearly if you "relocate" the
libraries to another directory entirely then an interpreter without any further nouse (and no
symbolic links to help it) is going to crap out badly.


clearly?

[fredrik@brain build] mv python2.3 /tmp
[fredrik@brain build] mkdir /tmp/lib
[fredrik@brain build] mv lib /tmp/lib/python2.3
[fredrik@brain build] cd /tmp
[fredrik@brain tmp]$ ./python2.3
import sys
sys.prefix '/tmp' sys.path ['', '/tmp/lib/python23.zip', '/tmp/lib/python2.3', ...] [fredrik@brain tmp]$ mkdir spam
[fredrik@brain tmp]$ mv python2.3 spam
[fredrik@brain tmp]$ mv lib spam
[fredrik@brain tmp]$ cd spam/
[fredrik@brain spam]$ ./python2.3 import sys
sys.prefix '/tmp/spam' sys.path ['', '/tmp/spam/lib/python23.zip', '/tmp/spam/lib/python2.3', ...]
[fredrik@brain spam]$ mkdir bin
[fredrik@brain spam]$ mv python2.3 bin
[fredrik@brain spam]$ bin/python2.3 import sys
sys.prefix '/tmp/spam'
[fredrik@brain spam]$ cd bin
[fredrik@brain bin]$ ./python2.3 import sys
sys.prefix '/tmp/spam'

[fredrik@brain fredrik]$ export PATH=/tmp/spam/bin:$PATH
[fredrik@brain bin]$ cd
[fredrik@brain fredrik]$ python2.3 import sys
sys.prefix '/tmp/spam'


and so on...

</F>

Jul 18 '05 #5
Fredrik Lundh wrote:
Steve Holden wrote:

Is there a way to make a relocateable python binary... that is... a
python installation that won't care where it is on the machine... and
won't care if it gets put somewhere else besides / ?
the standard CPython interpreter is 100% "relocatable". If you think
it isn't, you have to be a bit more specific.


Is it possible that you are using "relocatable" in the standard sense of "code can be located
anywhere in physical memory", where the OP is using the same term to mean "can live anywhere in
the filestore"?

nope.

I suspect the problem the OP is seeing is because the --prefix configuration parameter will cause
an interpreter to look in a specific place for standard libraries. Clearly if you "relocate" the
libraries to another directory entirely then an interpreter without any further nouse (and no
symbolic links to help it) is going to crap out badly.

clearly?

[fredrik@brain build] mv python2.3 /tmp
[fredrik@brain build] mkdir /tmp/lib
[fredrik@brain build] mv lib /tmp/lib/python2.3
[fredrik@brain build] cd /tmp
[fredrik@brain tmp]$ ./python2.3
import sys
sys.prefix
'/tmp'
sys.path
['', '/tmp/lib/python23.zip', '/tmp/lib/python2.3', ...]

[fredrik@brain tmp]$ mkdir spam
[fredrik@brain tmp]$ mv python2.3 spam
[fredrik@brain tmp]$ mv lib spam
[fredrik@brain tmp]$ cd spam/
[fredrik@brain spam]$ ./python2.3
import sys
sys.prefix
'/tmp/spam'
sys.path
['', '/tmp/spam/lib/python23.zip', '/tmp/spam/lib/python2.3', ...]
[fredrik@brain spam]$ mkdir bin
[fredrik@brain spam]$ mv python2.3 bin
[fredrik@brain spam]$ bin/python2.3
import sys
sys.prefix
'/tmp/spam'
[fredrik@brain spam]$ cd bin
[fredrik@brain bin]$ ./python2.3
import sys
sys.prefix
'/tmp/spam'

[fredrik@brain fredrik]$ export PATH=/tmp/spam/bin:$PATH
[fredrik@brain bin]$ cd
[fredrik@brain fredrik]$ python2.3
import sys
sys.prefix


'/tmp/spam'
and so on...

Well, OK, maybe it's not quite as clear as I thought :-)

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
Jul 18 '05 #6
Fredrik Lundh wrote:
Steve Holden wrote:

Is there a way to make a relocateable python binary... that is... a
python installation that won't care where it is on the machine... and
won't care if it gets put somewhere else besides / ?
the standard CPython interpreter is 100% "relocatable". If you think
it isn't, you have to be a bit more specific.


Is it possible that you are using "relocatable" in the standard sense of "code can be located
anywhere in physical memory", where the OP is using the same term to mean "can live anywhere in
the filestore"?

nope.

I suspect the problem the OP is seeing is because the --prefix configuration parameter will cause
an interpreter to look in a specific place for standard libraries. Clearly if you "relocate" the
libraries to another directory entirely then an interpreter without any further nouse (and no
symbolic links to help it) is going to crap out badly.

clearly?

[fredrik@brain build] mv python2.3 /tmp
[fredrik@brain build] mkdir /tmp/lib
[fredrik@brain build] mv lib /tmp/lib/python2.3
[fredrik@brain build] cd /tmp
[fredrik@brain tmp]$ ./python2.3
import sys
sys.prefix
'/tmp'
sys.path
['', '/tmp/lib/python23.zip', '/tmp/lib/python2.3', ...]

[fredrik@brain tmp]$ mkdir spam
[fredrik@brain tmp]$ mv python2.3 spam
[fredrik@brain tmp]$ mv lib spam
[fredrik@brain tmp]$ cd spam/
[fredrik@brain spam]$ ./python2.3
import sys
sys.prefix
'/tmp/spam'
sys.path
['', '/tmp/spam/lib/python23.zip', '/tmp/spam/lib/python2.3', ...]
[fredrik@brain spam]$ mkdir bin
[fredrik@brain spam]$ mv python2.3 bin
[fredrik@brain spam]$ bin/python2.3
import sys
sys.prefix
'/tmp/spam'
[fredrik@brain spam]$ cd bin
[fredrik@brain bin]$ ./python2.3
import sys
sys.prefix
'/tmp/spam'

[fredrik@brain fredrik]$ export PATH=/tmp/spam/bin:$PATH
[fredrik@brain bin]$ cd
[fredrik@brain fredrik]$ python2.3
import sys
sys.prefix


'/tmp/spam'
and so on...

Well, OK, maybe it's not quite as clear as I thought :-)

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119

Jul 18 '05 #7

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

Similar topics

0
by: Pieter Claassen | last post by:
I am developing an app that pulls loads of 3rd party python libraries/code in. The problem is that I don't want to require potential buyers to struggle to get the software going: Problems might...
20
by: Christian Stigen Larsen | last post by:
A signed int reserves one bit to signify whether a number is positive or negative. In light of this, a colleague asked me whether there existed an int in C++ that was -0, a zero with the negative...
3
by: Joe Coder | last post by:
Anyone know of any applications that monitor software installs and show you what the application did during install - like registry entries added/changed and DLLs registered and which files were...
0
by: InstallAware | last post by:
Dear Group If you want to perform a slipstreamed install of .NET Framework 1.1, including Service Pack 1, here's how. First, what do we mean by slipstreamed install? It means that version 1.1...
9
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the...
4
by: Jonny P. | last post by:
I am trying to release 2 applications based on the framework. A sound player and an Unicode tag editor. Both can be installed an run correctly in my system. I don't know if they can be...
2
by: Bishop | last post by:
I'm looking for any recommendations of tools or processes to develop an install that clients can run to install a web application on they're system. The web application is pretty simple; the...
0
by: David Garamond | last post by:
I'm making a "relocatable" Postgres binary distribution for my clients. Everything goes into postgresql-7.4.1/ directory, including libraries and binaries. This will be installed by a...
0
by: Bruno | last post by:
VS.net installs sql express as datastore for role/membership management. I don't like this! I'm not able to choose other databases like ms-access, in the Web Site Administration Tool . (Only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.