473,803 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

site-packages versus site-python

I recently installed python 2.4, and many installed software packages
stopped working. Some things got working after I copied some files and
directories from /usr/lib/python2.3/site-packages to
/usr/lib/python2.4/site-packages, but I also had to install a newer
PyXml package, as some of the files that came with python2.4 required a
newer version of pyxml than I had in python2.3/site-packages.

I wonder if there is any particular reason I have no
/usr/lib/site-python directory, and everything is installed in
version-specific site-packages.

I have Fedora Core 3. Is it the Fedora packagers who prefer installing
everything in the version-specific directory? Is there no way to have
older packages continue working in the presence of python2.4? (I still
want the newest to be the default!)

I have tried (cd /usr/bin; grep '#!.*python' * 2>/dev/null), and very
few of the programs have a specific version in the interpreter line. Is
there any good reason this is so?

Thinking about it, a particular python program may require a particular
module, but not any particular version of python or the module. The
module perhaps requires at least python2.3, but could run just as well
with python2.4 or later. It does not make sense to have the program
demand a particular version of python in its interpreter string (e.g.,
"#!/usr/bin/python2.3"), but what about the module. Would it be better
to put the module in site-python and include code to check the
interpreter version?

Perhaps there is no perfect solution that covers all permutations, but
on the other hand, what is currently the "correct philosophy" of
version handling?

Jul 18 '05 #1
3 1433
en***@online.no wrote:
I recently installed python 2.4, and many installed software packages
stopped working. Some things got working after I copied some files and
directories from /usr/lib/python2.3/site-packages to
/usr/lib/python2.4/site-packages, but I also had to install a newer
PyXml package, as some of the files that came with python2.4 required a
newer version of pyxml than I had in python2.3/site-packages.

I wonder if there is any particular reason I have no
/usr/lib/site-python directory, and everything is installed in
version-specific site-packages.
Well, broadly, the reason is that it allows version-specific code to be
included in libraries.

Of course, Python is so good at maintaining backward compatibility that
it's unlikely a pure Python module will fail to run on the next version
of Python. But you have to do this for extension modules, where the code
is compiled against a specific version of the Python interpreter API,
which doesn't stay the same from one version to the next.
I have Fedora Core 3. Is it the Fedora packagers who prefer installing
everything in the version-specific directory? Is there no way to have
older packages continue working in the presence of python2.4? (I still
want the newest to be the default!)

I have tried (cd /usr/bin; grep '#!.*python' * 2>/dev/null), and very
few of the programs have a specific version in the interpreter line. Is
there any good reason this is so?

Thinking about it, a particular python program may require a particular
module, but not any particular version of python or the module. The
module perhaps requires at least python2.3, but could run just as well
with python2.4 or later. It does not make sense to have the program
demand a particular version of python in its interpreter string (e.g.,
"#!/usr/bin/python2.3"), but what about the module. Would it be better
to put the module in site-python and include code to check the
interpreter version?

Perhaps there is no perfect solution that covers all permutations, but
on the other hand, what is currently the "correct philosophy" of
version handling?

The current "correct" philosophy is to have version-specific libraries.
Of course, there is nothing to stop you building your own
*no*-version-specific library directory and configuring it on to the
PYTHONPATH for each version you run.

regards
Steve
--
Meet the Python developers and your c.l.py favorites March 23-25
Come to PyCon DC 2005 http://www.pycon.org/
Steve Holden http://www.holdenweb.com/
Jul 18 '05 #2
> Well, broadly, the reason is that it allows version-specific code to
be
included in libraries.


I've actually found this to be a bit of a pain. I build packages
against say, python2.2, and if you upgrade python to 2.3 the package
breaks. The code works fine so saying it requires python >= 2.2 should
be valid, but the version-specific path prevents that.

Mike

Jul 18 '05 #3
msoulier wrote:
Well, broadly, the reason is that it allows version-specific code to


be
included in libraries.

I've actually found this to be a bit of a pain. I build packages
against say, python2.2, and if you upgrade python to 2.3 the package
breaks. The code works fine so saying it requires python >= 2.2 should
be valid, but the version-specific path prevents that.

Mike

Well, if you can invent a reliable mechanism for managing
version-independent extensions I'm sure the developers will be happy to
hear about it :-)

regards
Steve
--
Meet the Python developers and your c.l.py favorites March 23-25
Come to PyCon DC 2005 http://www.pycon.org/
Steve Holden http://www.holdenweb.com/
Jul 18 '05 #4

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

Similar topics

9
4532
by: Dieter Vanderelst | last post by:
Dear all, I'm currently comparing Python versus Perl to use in a project that involved a lot of text processing. I'm trying to determine what the most efficient language would be for our purposes. I have to admit that, although I'm very familiar with Python, I'm complete Perl noob (and I hope to stay one) which is reflected in my questions. I know that the web offers a lot of resources on Python/Perl differences. But I couldn't find a...
33
5602
by: Joshua D. Drake | last post by:
Hello, I think the below just about says it all: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg Sincerely, Joshua Drake
2
6741
by: Andrew Robinson | last post by:
I need to create a shared static field for use within a number of different classes. Which one should I be using or are they all really the same thing? public class Widget { private Widget() {} public static string DataField = string.Empty; } versus
2
4199
by: Jon Lapham | last post by:
I have a table that stores TEXT information. I need query this table to find *exact* matches to the TEXT... no regular expressions, no LIKE queries, etc. The TEXT could be from 1 to 10000+ characters in length, quite variable. If it matters, the TEXT may contain UNICODE characters... Example: CREATE TABLE a (id SERIAL, thetext TEXT); SELECT id FROM a WHERE thetext='Some other text'; One way I thought to optimize this process would...
135
7540
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
1
1847
by: johnpa60 | last post by:
Hello Anyone here has seen any materials on comparing DB2 CM versus Domino Doc Server? Can you please point me? If any of you have worked on both products, can you please spend few minutes comparing one versus another? Thank you
42
5469
by: John Doty | last post by:
I realized that I have a little job on the table that is a fine test of the Python versus Standard Forth code availability and reusability issue. Note that I have little experience with either Python or Standard Forth (but I have much experience with a very nonstandard Forth). I've noodled around a bit with both gforth and Python, but I've never done a serious application in either. In my heart, I'm more of a Forth fan: Python is a bit...
13
5026
by: blangela | last post by:
I have decided (see earlier post) to paste my Word doc here so that it will be simpler for people to provide feedback (by directly inserting their comments in the post). I will post it in 3 parts to make it more manageable. Below is a draft of a document that I plan to give to my introductory C++ class. Please note that I have purposely left out any mention of safety issues in the ctors which could be resolved thru some combination...
2
1706
by: John LaRusic | last post by:
Hi all, I'm fairly new to the world of schemas, but I have a question that I hope someone can help answer for me. I'm curious as to what the difference is between an element and a complexType? I know an element can be a complexType, so I guess what my issue is when I should define a complexType that's not contained in an element block, and when I should define a top-level element (what I mean by that is when I should define an...
4
8352
by: aj | last post by:
DB2 8.2 LUW FP14 Is there any real difference between select blahblahblah... where blah IN (select blah......) versus select blahblahblah... where blah = ANY (select blah.....) versus select blahblahblah... where exists (select blah.....) Is one more ANSI than another? Which is most portable?
0
9699
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10542
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
10309
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
10289
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
10068
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...
1
7600
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
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4274
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
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.