Re: [Qgis-developer] Force QGIS to use a different version of Python in Snow Leopard
On Tue, Aug 6, 2013 at 9:27 PM, William Kyngesburye wrote: > On Aug 6, 2013, at 2:10 PM, Jorge Arevalo wrote: > >> On Tue, Aug 6, 2013 at 8:23 PM, William Kyngesburye >> wrote: >>> 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. >>> >> >> Scipy is from the official page, yes. I tried downloading the sources >> and compiling them with system python (/usr/bin/python2.6 setup.py >> build), but I got a bunch of errors. I guess that's what you're >> dealing with. >> >> I also installed Python 2,7 from Python.org, but I didn't install Python 2.6. >> >> The difference I saw is that sys.path is not the same from command >> line (Python 2.6) than from QGIS console. From QGIS console, sys.path >> doesn't include the Scipy 0.12 location. From command line, does. >> >> >>> 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. >> >> Yes. python and python2.7 are the same: >> /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7, and >> /usr/local/bin/python is also a symlink to the previous one. But >> python2.6 is /usr/bin/python2.6 (system Python). >> >> I feel confused for this reason: >> >> - Executing python2.6 from command line (system Python, not installed >> by me): scipy 0.12 is detected >> - Executing python from QGIS console (I assume is also system Python, >> as you said): scipy 0.11 is detected >> >> Difference is in sys.path. From QGIS console doesn't include the >> location of Scipy 0.12. From command line does. >> >> But I don't want to mess things up and wasting your time. I'll wait. > > > One possibility then is that your ~/.bash_profile has a PYTHONPATH setting, > maybe from installing Python 2.7, to add the > Library/Frameworks/Python.framework/... site-packages to your sys.path. This > would let the system python see modules installed in the python.org python > folder, but QGIS won't see these because OS X applications don't get the > shell environment. > > Using PYTHONPATH to add python.org stuff to the system python is a bit > dangersous because binary components of modules (ie scipy has binary code) > are built for a specific version of Python (but not necessarily same > installation in this case). Loading scipy for python.org 2.7, in system > python 2.6 may seem to load fine but have problems when you try to use scipy > functionality, but a scipy for python.org 2.6 should work in the system > python 2.6. > > Ok, it was that. So silly. You're right. I'll delete the PYTHONPATH setting from the profile file. So, I guess the only way is to recompile QGIS to use the newer version of Python (with Scipy 0.12) or compile Scipy 0.12 to be used with system Python. If you're working on it, that will be great (it's necessary for QGIS Animove plugin support on Mac, one project I've been working on) Best regards, -- Jorge Arévalo http://geomati.co ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Force QGIS to use a different version of Python in Snow Leopard
On Aug 6, 2013, at 2:10 PM, Jorge Arevalo wrote: > On Tue, Aug 6, 2013 at 8:23 PM, William Kyngesburye > wrote: >> 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. >> > > Scipy is from the official page, yes. I tried downloading the sources > and compiling them with system python (/usr/bin/python2.6 setup.py > build), but I got a bunch of errors. I guess that's what you're > dealing with. > > I also installed Python 2,7 from Python.org, but I didn't install Python 2.6. > > The difference I saw is that sys.path is not the same from command > line (Python 2.6) than from QGIS console. From QGIS console, sys.path > doesn't include the Scipy 0.12 location. From command line, does. > > >> 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. > > Yes. python and python2.7 are the same: > /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7, and > /usr/local/bin/python is also a symlink to the previous one. But > python2.6 is /usr/bin/python2.6 (system Python). > > I feel confused for this reason: > > - Executing python2.6 from command line (system Python, not installed > by me): scipy 0.12 is detected > - Executing python from QGIS console (I assume is also system Python, > as you said): scipy 0.11 is detected > > Difference is in sys.path. From QGIS console doesn't include the > location of Scipy 0.12. From command line does. > > But I don't want to mess things up and wasting your time. I'll wait. One possibility then is that your ~/.bash_profile has a PYTHONPATH setting, maybe from installing Python 2.7, to add the Library/Frameworks/Python.framework/... site-packages to your sys.path. This would let the system python see modules installed in the python.org python folder, but QGIS won't see these because OS X applications don't get the shell environment. Using PYTHONPATH to add python.org stuff to the system python is a bit dangersous because binary components of modules (ie scipy has binary code) are built for a specific version of Python (but not necessarily same installation in this case). Loading scipy for python.org 2.7, in system python 2.6 may seem to load fine but have problems when you try to use scipy functionality, but a scipy for python.org 2.6 should work in the system python 2.6. - William Kyngesburye http://www.kyngchaos.com/ "Oh, look, I seem to have fallen down a deep, dark hole. Now what does that remind me of? Ah, yes - life." - Marvin ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Force QGIS to use a different version of Python in Snow Leopard
On Tue, Aug 6, 2013 at 8:23 PM, William Kyngesburye wrote: > 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. > Scipy is from the official page, yes. I tried downloading the sources and compiling them with system python (/usr/bin/python2.6 setup.py build), but I got a bunch of errors. I guess that's what you're dealing with. I also installed Python 2,7 from Python.org, but I didn't install Python 2.6. The difference I saw is that sys.path is not the same from command line (Python 2.6) than from QGIS console. From QGIS console, sys.path doesn't include the Scipy 0.12 location. From command line, does. > 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. Yes. python and python2.7 are the same: /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7, and /usr/local/bin/python is also a symlink to the previous one. But python2.6 is /usr/bin/python2.6 (system Python). I feel confused for this reason: - Executing python2.6 from command line (system Python, not installed by me): scipy 0.12 is detected - Executing python from QGIS console (I assume is also system Python, as you said): scipy 0.11 is detected Difference is in sys.path. From QGIS console doesn't include the location of Scipy 0.12. From command line does. But I don't want to mess things up and wasting your time. I'll wait. > > 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 >> 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 > 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 > > -- Jorge Arévalo http://geomati.co ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Force QGIS to use a different version of Python in Snow Leopard
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 > 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 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 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Force QGIS to use a different version of Python in Snow Leopard
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 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@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/qgis-developer > > - > William Kyngesburye > 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 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Force QGIS to use a different version of Python in Snow Leopard
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@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-developer - William Kyngesburye 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 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer