9

has anybody been successful getting pandas to work with QGIS's Python installation, on Windows? I've used the OSGeo4W installer to install QGIS2.2, which comes with Python 2.7 and Numpy 1.5.1. Any reasonably new version of pandas requires Numpy 1.6.1 or newer. So that seems like my main problem. I've tried: - Building an older version of pandas (e.g. 0.7.3 and 0.4.1) using easy_install, but that gives me a very long list of errors, at least the last of which are related to distutils\msvc9compiler.py - Using binaries of old pandas versions, but they are all built for Numpy 1.6.1 - Upgrading Numpy, which also gives me an error message. In case anybody is interested, the message ends with "File “C:\OSGeo4W\apps\Python27\lib\distutils\msvc9compiler.py”, line 299, in query_vcvarsall” newline “raise ValueERror(str(list(result.keys())))” newline “ValueError: [u’path’]"

I'm wondering if anybody else has ever been successful in getting pandas to work with a QGIS install on Windows??

It would be so easy if QGIS would ship with, say, a version of Numpy that's less than three years old. Does anybody know if such an upgrade is in the works for upcoming QGIS versions?

1

I'm not using the OSGeo4W package but rather the standalone QGIS latest release. I was able to import Pandas into the QGIS python instance by taking the following simple steps. Perhaps the same will work for you or with some minor tweaks.

  1. Install Anaconda: this has the packaged Pandas library readily available in the site-packages folder.
  2. Copy paste the Pandas folder from the Anaconda site-packages and paste into your QGIS site-packages folder. I also included the pandas egg-info file.
  3. At this point I thought it would work but the import was throwing an error about not finding pkg_resources.py. I found that and the .pyc in the Anaconda pip folder and pasted both in the QGIS site-packages folder.

After taking the above steps, I was able to cleanly import Pandas into my PyQGIS environment without any problems.

1

You can easily upgrade numpy by using Christoph Gohlkes precompiled Numpy wheels.

  1. Download the correct Numpy wheel
  2. Open a OSGeo4W Shell
  3. pip install numpy‑1.9.2+mkl.whl
  4. pip install pandas

I did this on my machine and so far encountered no dependency errors in QGIS with the newer numpy version.

-1

Thanks for the answer, I had found a solution in the meantime, outlined here: http://www.andersknudby.com/blog/how-i-got-otb-and-pandas-to-work-together, but had forgotten to update this question accordingly. Glad you approach worked for you as well.

  • This is currently a link-only answer. Could you summarize it in case the link goes down in the future? – Mast Jan 21 '17 at 18:41
  • Aaaaaaand the link is dead. :-( – Nick K9 Aug 31 '18 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.