[Pythonmac-SIG] Problem with numpy on Leopard

Christopher Barker Chris.Barker at noaa.gov
Fri Nov 2 21:06:08 CET 2007


Ned Deily wrote:
> The easiest way is to use the install_requires keyword in setup.py.  See 
> the setuptools documentation here:
> 
>  <http://peak.telecommunity.com/DevCenter/setuptools>

That appears to handle dependencies:

install_requires
A string or list of strings specifying what other distributions need to 
be installed when this one is. See the section below on Declaring 
Dependencies for details and examples of the format of this argument.

Which looks quite dangerous, as a matter of fact. For example, I do

easy_install foo

foo has install_requires("numpy==1.0.3")

now setuptools will download and install numpy1.0.3, but it won't get 
used, 'cause there is an older numpy earlier on the pythonpath.


Anyway, I won't looking for dependency management, I was looking for 
runtime version management: i.e have numpy1.0.2 and numpy1.0.3 both 
installed, and specify in a given script which one I want to use. If 
there's a way to do that, then when you develop and test, you specify 
which numpy to use, if you, or another user has multiple versions 
installed, the correct one is use. wxPython handles this with a custom 
system:

import wxversion
wxversion.select('2.4')

or, if you've tested against more than one version:

wxversion.select(['2.5.4', '2.5.5', '2.6'])

I think PyGtk has a similar system

If this was a universal python package feature, and people used it, a 
lot of these problems would go away.

oh well, I got little support for this a few years ago, I doubt it will 
change now. I think virtualenv may be the answer -- and maybe it's a 
better one anyway -- I'll have to give it a shot.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list