[Qgis-user] Pandas in QGIS - MAC

William Kyngesburye woklist at kyngchaos.com
Fri Aug 17 06:17:20 PDT 2018


The QGIS 3 readme has instructions about installing extra python modules.  Note that you use "pip3", not pip, to make sure you get the python 3 version.  Also, not mentioned in the readme - since you have Anaconda installed, even pip3 may install for Anaconda, so you may need to give the full path to pip3:

sudo /Library/Frameworks/Python.framework/Versions/3.6/bin/pip3 install pandas

> On Aug 17, 2018, at 4:14 AM, Philip Hamoui <philippos86 at gmail.com> wrote:
> 
> Sorry for being late in replying here.
> 
> I already have tried installing QGIS 3, still the problem is there. 
> However, I simply copied pandas from anaconda path to QGIS package content, apparently I move a step forward, however, now I am getting the following error.
> 
> ImportError: Missing required dependencies ['numpy']
> 
> When I try to import numpy independently, I get this:
> 
> ImportError: 
> Importing the multiarray numpy extension module failed.  Most
> likely you are trying to import a failed build of numpy.
> If you're working with a numpy git repo, try `git clean -xdf` (removes all
> files not under version control).  Otherwise reinstall numpy.
> 
> Sorry again for making this thread even longer, but I really need to figure this out and I feel it's doable. 
> If simply I could: 
> [1] use pip inside QGIS
> or, [2] find a way to force QGIS to use my anaconda python
> I think there would be no problem.
> I have been surfing for 2 days so far and trying every possible way, but still nothing is working so far .. 
> 
> On Thu, 16 Aug 2018 at 11:25, William Kyngesburye <woklist at kyngchaos.com <mailto:woklist at kyngchaos.com>> wrote:
> Well, it looks like pandas has some C code, it's not pure Python, so you would need Xcode tools installed to be able to install pandas.
> 
> Also note that QGIS 2.18 on Mac (my "official" build) uses the system Python 2.7.  It can NOT use any other Python, like Anaconda, since it is linked to the Python library.
> 
> MAYBE, if you install into Anaconda that is based on Python 2.7, you could then copy it into the user site-packages at /Library/Python/2.7/site-packages.  You'd have to make sure its dependencies are also installed (part of my QGIS stack includes numpy and pytz).
> 
> I suggest installing QGIS 3, which uses the python.org <http://python.org/> Python 3.6 (again, NOT Anaconda or other python), which has a prebuilt wheel for pandas that can be installed with pip3, no Xcode needed.
> 
>> On Aug 15, 2018, at 8:29 AM, Philip Hamoui <philippos86 at gmail.com <mailto:philippos86 at gmail.com>> wrote:
>> 
>> Hello everyone, 
>> 
>> This is my first time using this service, and not quite sure how to use it.
>> 
>> This is my question:
>> 
>> I'm on MAC, and I want to import pandas into my QGIS V2.18.
>> 
>> I have tried following the steps of this answer on StackOverflow <https://stackoverflow.com/questions/31532501/how-to-install-pandas-library-in-qgis-python/31533128#31533128> and raised an issue GitHub <https://github.com/pandas-dev/pandas/issues/22340#issuecomment-412953428>. 
>> 
>> Uninstalled and reinstalled pandas using pip, and confirm its added to the PATH, still not working.
>> 
>> How can I add pandas to my QGIS?
>> 
>> 
>> Philip
>> -- 
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user <https://lists.osgeo.org/mailman/listinfo/qgis-user>
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/ <http://www.kyngchaos.com/>
> 
> "Mon Dieu! but they are all alike.  Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings.  And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....
> 
> - the wisdom of Tarzan
> 
> 
> 
> 
> -- 

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

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable.  There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180817/d54f95d9/attachment.html>


More information about the Qgis-user mailing list