[Qgis-developer] Force QGIS to use a different version of Python in Snow Leopard

William Kyngesburye woklist at kyngchaos.com
Tue Aug 6 11:23:21 PDT 2013


Where did you get this Scipy?  If it's from Scipy, then it is NOT for the system Python, and you probably installed Python 2.6 (as well as 2.7) from Python.org.  I don't know of anyone else building a Scipy for the system python, or I wouldn't bother myself.

Same version of Python does not necessarily mean same installation of Python, on OS X.  From the Terminal you can find out what Python is found:

type python
type python2.6
type python2.7

System pythons will be in /usr/bin.  python.org python will probably be in /usr/local/bin, or /Library/Frameworks.

On Aug 6, 2013, at 1:03 PM, Jorge Arevalo wrote:

> Many thanks for your response, William.
> 
> It's curious, because I've installed scipy 0.12 for system Python from
> command line, but QGIS can't detect it. So, if I execute this from
> command line:
> 
> python2.6
>>>> import scipy
>>>> scipy.version.version
> 
> I see 0.12 as version number. But from QGIS plugins --> Python
> console, if I execute
> 
>>>> import scipy
>>>> scipy.version.version
> 
> I see 0.11.0
> 
> Even when I'm using the same Python version (exactly the same), the
> Python path is different in console than in QGIS. And I don't know
> why.
> 
> Here, a screenshot that explains this:
> https://dl.dropboxusercontent.com/u/6599273/errors/qgis/qgis_python.png
> 
> 
> On Tue, Aug 6, 2013 at 3:41 PM, William Kyngesburye
> <woklist at kyngchaos.com> wrote:
>> You can't.  QGIS includes its own python interpreter and links directly to the Python framework.  This ties it to a specific version and distribution (ie system Python 2.6).  You either need to compile your own QGIS to use the other python, or install scipy for the system python.
>> 
>> I'm working on updating my Scipy distribution if you can wait, I just got distracted by the fortran requirement.
>> 
>> On Aug 6, 2013, at 5:07 AM, Jorge Arevalo wrote:
>> 
>>> Hello,
>>> 
>>> I'm using QGIS 1.8.0 for Snow Leopard, downloaded from KingChaos wiki
>>> (http://www.kyngchaos.com/software/qgis). Once I open QGIS plugin
>>> console, I can see QGIS is using Snow Leopard's default Python
>>> (2.6.1).
>>> 
>>> At the same time, I've installed Python 2.7.5 and some packages I
>>> need, like numpy or scipy. Specifically, I need scipy 0.12. If I open
>>> python from a command line, version 2.7.5 is used.
>>> 
>>> The problem is I need that QGIS also uses Python 2.7, to detect scipy
>>> 0.12 (default system Python, 2.6.1, uses scipy 0.11.0). Default Python
>>> is installed at /Library/Python, but my manually installed Python 2.7
>>> is installed at /Library/Frameworks/Python.Framework. I guess QGIS
>>> looks for default Python first.
>>> 
>>> How could I "force" QGIS to use my own Python version? Do I have to
>>> compile it by myself, instead of using KingChaos packages? I was
>>> thinking in something easier, like modifying Python path just for
>>> QGIS.
>>> 
>>> Best regards

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian]  What are you supposed to do WITH a maniacally depressed robot?

[Marvin]  You think you have problems?  What are you supposed to do if you ARE a maniacally depressed robot?  No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer...

- HitchHiker's Guide to the Galaxy




More information about the Qgis-developer mailing list