473,385 Members | 1,620 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,385 software developers and data experts.

Manging multiple Python installation

Hi,
I run Mandrake 10.0 with python 2.3 installed by default. I want to keep
it as it is but need another, very customized Python installation based
of 2.3 as well. I would prefer to have it the way it is on Windows, one
folder e.g. /opt/mypython with all the stuff under that. It would be
unlike that standard installation where everything is scattered across
/usr /bin/ /.../doc. That way I can easily tar it and distribute to
whatever machine I want.

How can I achieve that? Please help, Andy
Sep 8 '05 #1
9 1777
Andy Leszczynski wrote:
Hi,
I run Mandrake 10.0 with python 2.3 installed by default. I want to keep
it as it is but need another, very customized Python installation based
of 2.3 as well. I would prefer to have it the way it is on Windows, one
folder e.g. /opt/mypython with all the stuff under that. It would be
unlike that standard installation where everything is scattered across
/usr /bin/ /.../doc. That way I can easily tar it and distribute to
whatever machine I want.

How can I achieve that? Please help, Andy

Download the source, untar, cd to the new directory, run:

../configure --prefix=/opt/mypython
make
make install

HTH,

JMJ
Sep 8 '05 #2
Jeremy Jones wrote:
Andy Leszczynski wrote:

Download the source, untar, cd to the new directory, run:

./configure --prefix=/opt/mypython
make
make install


Is there any way to pass the prefix to the "make install"? Why "make"
depends on that?

A.
Sep 8 '05 #3
Andy Leszczynski wrote:
Jeremy Jones wrote:
Andy Leszczynski wrote:

Download the source, untar, cd to the new directory, run:

./configure --prefix=/opt/mypython
make
make install
Is there any way to pass the prefix to the "make install"?


Is passing it to the configure script a problem?
Why "make"
depends on that?


I think that parts of the configuration depend on knowing the ultimate
installation location. Specifically, you might have problems building
extension modules using distutils.

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Sep 8 '05 #4
Robert Kern wrote:
Andy Leszczynski wrote:
Jeremy Jones wrote:

Andy Leszczynski wrote:

Download the source, untar, cd to the new directory, run:

./configure --prefix=/opt/mypython
make
make install


Is there any way to pass the prefix to the "make install"?

Is passing it to the configure script a problem?


not really but seems to be a bit illogical to me that the build (set of
executables and libraries) depends on the destination installation path.

Under M$ Windows I was able to install Python in let's say C:\Program
Files\python and then move/copy it frelly to whatever location I need.
Only thing was the resetting PATH to the new location. I miss that under
Linux.

A.
Sep 8 '05 #5
Andy Leszczynski wrote:
Jeremy Jones wrote:

Andy Leszczynski wrote:

Download the source, untar, cd to the new directory, run:

./configure --prefix=/opt/mypython
make
make install


Is there any way to pass the prefix to the "make install"? Why "make"
depends on that?

A.

What does it matter? If you *could* pass it to make, what does that buy
you? I'm not a make guru, but I'm not sure you can do this. Someone
else better versed in make will certainly chime in if I'm wrong. But I
think make just looks at the Makefile and does what it's going to do.
If you want different behavior, you edit the Makefile or you get the
Makefile created differently with configure.

JMJ
Sep 8 '05 #6
Andy Leszczynski <leszczynscyATnospam.yahoo.com.nospam> writes:
Robert Kern wrote:
Andy Leszczynski wrote:
Jeremy Jones wrote:
Andy Leszczynski wrote:

Download the source, untar, cd to the new directory, run:

./configure --prefix=/opt/mypython
make
make install

Is there any way to pass the prefix to the "make install"? Is passing it to the configure script a problem?


not really but seems to be a bit illogical to me that the build (set
of executables and libraries) depends on the destination installation
path.


It's not clear that the build depends on the destination. The
install does, though. The Makefile does the install, so it needs the
prefix. config builds the makefile, so it also needs the prefix.
Under M$ Windows I was able to install Python in let's say C:\Program
Files\python and then move/copy it frelly to whatever location I
need. Only thing was the resetting PATH to the new location. I miss
that under Linux.


Are you sure it doesn't work well enough for you to use on Linux? A
quick grep on the python binary and library files reveal that only
pydoc knows the prefix - and that points to files that don't exist on
my system. That leaves five things to worry about: unix avoids making
the user muck with the path by installing the binary in the path, so
you have to move the binaries and the libraries separately. The pydoc
executable uses the path to the python binary in it's #! line. If you
use the shared binary, you may have to muck with the load library
state information (not sure what to use to do this on your
Linux). Third party libraries may break. Oh yeah - tracebacks on .pyc
and .pyo files may be confused because the source files aren't where
they where when the file was generated, but that should be the same
as it is on Windows.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Sep 8 '05 #7
Jeremy Jones wrote:
Andy Leszczynski wrote:

Is there any way to pass the prefix to the "make install"? Why "make"
depends on that?

A.


What does it matter? If you *could* pass it to make, what does that buy
you? I'm not a make guru, but I'm not sure you can do this. Someone
else better versed in make will certainly chime in if I'm wrong. But I
think make just looks at the Makefile and does what it's going to do.
If you want different behavior, you edit the Makefile or you get the
Makefile created differently with configure.


That way you could install to a different directory without having to
rebuild the whole thing. I don't think that uses case happens very
often, but I've certainly encountered it (not in relation to Python though).

--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton

Roel Schroeven
Sep 8 '05 #8
Roel Schroeven wrote:
Jeremy Jones wrote:
Andy Leszczynski wrote:

Is there any way to pass the prefix to the "make install"? Why "make"
depends on that?

A.

What does it matter? If you *could* pass it to make, what does that buy
you? I'm not a make guru, but I'm not sure you can do this. Someone
else better versed in make will certainly chime in if I'm wrong. But I
think make just looks at the Makefile and does what it's going to do.
If you want different behavior, you edit the Makefile or you get the
Makefile created differently with configure.


That way you could install to a different directory without having to
rebuild the whole thing. I don't think that uses case happens very
often, but I've certainly encountered it (not in relation to Python though).

I guess I'm still having a hard time understanding "what does it
matter?". Even if he reconfigures, he's not going to rebuild the whole
thing unless he does a make clean. For example, I just built Python
twice, once with a prefix of /usr/local/apps/pytest1 and then with a
prefix of /usr/local/apps/pytest2 and timed the compile:

BUILD 1:

jmjones@qiwi 7:16AM Python-2.4.1 % cat compile_it.sh
../configure --prefix=/usr/local/apps/pytest1
make
make install

../compile_it.sh 107.50s user 9.00s system 78% cpu 2:28.53 total

BUILD 2:

jmjones@qiwi 7:18AM Python-2.4.1 % cat compile_it.sh
../configure --prefix=/usr/local/apps/pytest2
make
make install

../compile_it.sh 21.17s user 6.21s system 56% cpu 48.323 total
I *know* a significant portion of the time of BUILD 2 was spent in
configure. So if he's really eager to save a few CPU seconds, he can
edit the Makefile manually and change the prefix section. Maybe I'm
just a slow file editor, but I would do configure again just because
it'd probably be faster for me. Not to mention potentially less error
prone. But he's going to have to build something again. Or not. He
*should* be able to just tar up the whole directory and it should "just
work". I moved /usr/local/apps/pytest1 to /usr/local/apps/pyfoo and
imported xml.dom.minidom and it worked. I'm guessing the python binary
searches relative to itself first (??). But if I move the python binary
to a new location, it doesn't find xml.dom.minidom.

JMJ
Sep 8 '05 #9
Jeremy Jones wrote:
I guess I'm still having a hard time understanding "what does it
matter?".

I was under impression that configure embeds the prefix in the build
itself. I was concerned to have to preform the configure/make every time
I change the destination path. It turns out that the makefile produced
by configure uses prefix only for the install. Thus it is not big deal
anymore.

Thx for all commnets.

A.

Sep 14 '05 #10

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

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
3
by: Matthias Baas | last post by:
Hi, are there any guidelines about what to do if a Windows extension for Python 2.4 requires the C++ runtime (msvcp71.dll)? If I want to distribute a binary installer of an extension that...
9
by: TPJ | last post by:
First I have to admit that my English isn't good enough. I'm still studying and sometimes I just can't express what I want to express. A few weeks ago I've written 'Python Builder' - a bash...
17
by: Anthony Baxter | last post by:
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.4.2 (final). Python 2.4.2 is a bug-fix release. See the release notes at the ...
0
by: Pavan | last post by:
I have my .NET code published in two servers http://server1/<ApplicationName>/Publish.htm and http://server2/<ApplicationName>/Publish.htm, and if i open IE on the client machine and type the link...
1
by: Srijit Kumar Bhadra | last post by:
I have browsed the following links 1) http://peak.telecommunity.com/DevCenter/EasyInstall 2) When Python *Eggs* better than Python *distutils*?? What's Eggs? (http://tinyurl.com/m8dyd) But I am...
3
by: Cowmix | last post by:
For my day job I am forced to run RHEL3 (and Centos3 on my desktop). I want to be able to use a few applications that require Python 2.4.X but RHEL3 ships with Python 2.2.3. I have tried to install...
2
by: j_nwb | last post by:
HI I have multiple python installations. 2.2, 2.3, 2.4. When I install a new package (pygtk2) , it always install in python 2.3. I changed the /usr/bin/python to be 2.4 binary. Still the same...
1
by: John | last post by:
I have a suse box that has by default python 2.4 running and I have a 2.5 version installed in /reg/python2.5. How do I install new modules for only 2.5 without disturbing the 2.4 default...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.