Python loading system numpy in preference to MacPorts version (Lion)
|Reported by:||jamie@…||Owned by:||macports-tickets@…|
|Keywords:||Cc:||guygurari@…, ptmkenny@…, bardeau@…, Russell-Jones-OxPhys (Russell Jones), ttimo@…, jyrkiwahlstedt, dh@…, michaelld (Michael Dickens), tsutterley@…, dershow, petrrr, larryv (Lawrence Velázquez)|
Description (last modified by ryandesign (Ryan Schmidt))
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:
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?