[MacPorts] #31891: Python loading system numpy in preference to MacPorts version (Lion)

MacPorts noreply at macports.org
Fri Nov 4 08:31:14 PDT 2011


#31891: Python loading system numpy in preference to MacPorts version (Lion)
------------------------------+---------------------------------------------
 Reporter:  jamie@…           |       Owner:  macports-tickets@…                   
     Type:  defect            |      Status:  new                                  
 Priority:  Normal            |   Milestone:                                       
Component:  ports             |     Version:  2.0.3                                
 Keywords:                    |        Port:                                       
------------------------------+---------------------------------------------
Description changed by ryandesign@…:

Old description:

> I'm having an issue where python scripts are loading the system numpy
> version instead of the MacPorts compiled version, this leads to the
> following error message:
>
> RuntimeError: module compiled against API version 6 but this version of
> numpy is 4
>
> and in some cases (e.g. scripts that use matplotlib) causes crashes.
>
> This has only started occurring on my system since I upgraded to OS X
> Lion.
>
> The fix so far seems to be to add the following code to the top of each
> script before loading numpy:
>
> sys.path.reverse()
>
> but this is extremely kludgy fix, and I never had to previously do this.
> My PYTHONPATH variable points to my local python repository and to the
> MacPorts site-packages directory only. Is there somewhere else I can tell
> python to stop loading stuff from
> /System/Library/Frameworks/Python.framework?

New description:

 I'm having an issue where python scripts are loading the system numpy
 version instead of the MacPorts compiled version, this leads to the
 following error message:

 {{{
 RuntimeError: module compiled against API version 6 but this version of
 numpy is 4
 }}}

 and in some cases (e.g. scripts that use matplotlib) causes crashes.

 This has only started occurring on my system since I upgraded to OS X
 Lion.

 The fix so far seems to be to add the following code to the top of each
 script before loading numpy:

 {{{
 sys.path.reverse()
 }}}

 but this is extremely kludgy fix, and I never had to previously do this.
 My PYTHONPATH variable points to my local python repository and to the
 MacPorts site-packages directory only. Is there somewhere else I can tell
 python to stop loading stuff from
 /System/Library/Frameworks/Python.framework?

--

-- 
Ticket URL: <https://trac.macports.org/ticket/31891#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list