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

Jorge Arevalo jorge.arevalo at geomati.co
Tue Aug 6 11:03:51 PDT 2013


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,
>>
>>
>> --
>> Jorge Arévalo
>> http://geomati.co
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
>
> "This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"
>
> - The Ruler of the Universe
>
>



-- 
Jorge Arévalo
http://geomati.co


More information about the Qgis-developer mailing list