473,473 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

conditional install/distribution

Is there a feature in distutils or easy_install to specify what
version of python that the target package can be installed? For
example, if a package has a module that only needed if the python
version < 2.6, is there a way to specifiy that in setup.py or
easy_install cfg file so that when installing to python >= 2.6, this
module wouldn't be installed??

Thanks,
Jim
Sep 11 '08 #1
3 956
i3dmaster schrieb:
Is there a feature in distutils or easy_install to specify what
version of python that the target package can be installed? For
example, if a package has a module that only needed if the python
version < 2.6, is there a way to specifiy that in setup.py or
easy_install cfg file so that when installing to python >= 2.6, this
module wouldn't be installed??
you can simply import sys and check sys.version in the setup-script, and
abort with an error-message if the expectations aren't matched.

Diez
Sep 11 '08 #2
On Sep 11, 11:07*am, "Diez B. Roggisch" <de...@nospam.web.dewrote:
i3dmasterschrieb:
Is there a feature in distutils or easy_install to specify what
version of python that the target package can be installed? For
example, if a package has a module that only needed if the python
version < 2.6, is there a way to specifiy that in setup.py or
easy_install cfg file so that when installing to python >= 2.6, this
module wouldn't be installed??

you can simply import sys and check sys.version in the setup-script, and
abort with an error-message if the expectations aren't matched.

Diez
I know I can precheck the version, but the real issue is how I can
prevent from installing a specific module? Actually, the rest of the
package should still be installed but just not a particular module
because the feature is built in after 2.6.
Sep 12 '08 #3
i3dmaster schrieb:
On Sep 11, 11:07 am, "Diez B. Roggisch" <de...@nospam.web.dewrote:
>i3dmasterschrieb:
>>Is there a feature in distutils or easy_install to specify what
version of python that the target package can be installed? For
example, if a package has a module that only needed if the python
version < 2.6, is there a way to specifiy that in setup.py or
easy_install cfg file so that when installing to python >= 2.6, this
module wouldn't be installed??
you can simply import sys and check sys.version in the setup-script, and
abort with an error-message if the expectations aren't matched.

Diez
I know I can precheck the version, but the real issue is how I can
prevent from installing a specific module? Actually, the rest of the
package should still be installed but just not a particular module
because the feature is built in after 2.6.
How about simply not importing the module in question if the version is
not proper? Or even a

try:
import a_module_requiring_2_6
except (SyntaxError, ImportError):
pass

Diez
Sep 15 '08 #4

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

Similar topics

5
by: Logan | last post by:
I have two different Python versions on my Linux system (2.2 and 2.3). I cannot remove version 2.2 because many configuration files of the system depend on this version of Python (and its...
1
by: jtan325 | last post by:
hi, i am running Linux Ubuntu Hoary and am trying to build the Python numarray package, v. 1.3.2 by hand since ubuntu's repos won't be updated until breezy. i have python 2.4, and gcc 3.3.5 ...
3
by: Chuck Arney | last post by:
After installing Office 2003 PRO and attempting to run SETUP to install the Visual Studio Tools for Office version 2003, I get the error message "Your computer must have Microsoft Office...
2
by: Andrew Wiles | last post by:
Hi I have an application which (along with many other things) uses the COM interop classes for "Microsoft Decision Support Objects" (DSO). I have done no more than included the DSO components as...
3
by: Google Mike | last post by:
On Linux, I need to ask what your favorite installation options are for a PHP app as a kind of poll. In this first part, I discuss the Install Wizard choices. In Part 2, I discuss the database...
2
by: Wesley | last post by:
HELP, Could anyone help me with this one. I am building query that includes postall addresses, I would like to be able to include calculated control "REGION" which would disply either "CITY"...
3
by: John | last post by:
Hi I have an app to deal with two companies A & B within a group of companies depending on which database is selected. Is it possible for setup to ask the user at install time which company they...
5
by: funkyj | last post by:
I love pexpect because it means I may never have to use expect again (I don't do any heavy expect lifting -- I just need simple tty control)! As a python advocate I find it embarassing how...
9
by: Charles Law | last post by:
Hi chaps I realise that this is a .NET group, but please don't shoot me down quite yet. I looked in the vb classic groups and there seems to be so little activity there that I was not hopeful of...
2
by: djoefish | last post by:
sequel to the topic "install patch on windows"..... I am currently running Python2.3 with Enthought on a windows PC. I have been running into a memory problem (see...
0
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,...
0
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,...
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...
1
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...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.