2

I have matplotlib installed on a Mac (Mavericks) via pip, which means the matplotlib files get installed under /System/Library/...

I tried installing the most recent version of QGIS, and the install fails because it can't find matplotlib. I'm thinking this is because I didn't use easy_install, which appears to put packages instead under /Library/...

Is there an easy way to tell QGIS to look for packages under /System/Library - is it merely a matter of setting some environment variable that QGIS looks at ?

thanks !

Update:

  • I'm installing QGIS from the .dmg package provided at kyngchaos.com
  • the error message started when I double click the .dmg to install it. I get a popup complaining that matplotlib is not installed even though it is installed and command line python can see it.

I believe (based on other notes at kyngchaos.com) that the difference is because of my use of python.org python and pip instead of system python, and the different place that libraries are placed in.

5
  • Please provide more information. How are you installing QGIS (method and from what source)? When you say the install fails, in what way, e.g. error in an installer? BTW, Python packages should never need to be installed in /System/Library/... and pip should not be installing files there, i.e. if it is, there is something wrong.
    – dakcarto
    May 19, 2014 at 20:58
  • could you uninstall matplotlib and reinstall using the methods outlined at kyngchaos? This works well for me on Mavericks. Is there any particular reason you need to do things differently? May 19, 2014 at 23:14
  • @StephenLead is correct (please add as answer). The KyngChaos install does not support non-system Python installs; so, you will need to install matplotlib in system Python's site-packages. The best means is to use KyngChaos's installer.
    – dakcarto
    May 19, 2014 at 23:25
  • i have same problem. matplotlib is in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib and the qgis installer is not picking it up. rather than uninstalling it, what can i do to make the qgis installer pick it up from this directory?
    – morpheus
    Sep 14, 2015 at 22:19
  • i even tried moving matplotlib to /Library/Python/2.7/site-packages/matplotlib but the QGIS installer still cannot find it. it is super lame!
    – morpheus
    Sep 14, 2015 at 23:06

2 Answers 2

2

Could you uninstall matplotlib and reinstall using the methods outlined at Kyngchaos?

This works well for me on Mavericks. Is there any particular reason you need to do things differently?

As noted by @dakcarto above, it appears that

The KyngChaos install does not support non-system Python installs; so, you will need to install matplotlib in system Python's site-packages. The best means is to use KyngChaos's installer.

2
  • There are various reasons that pip is a cleaner installer than other methods (SO has various threads on this). But I did as you suggest and was able to get QGIS to install. Thanks ! May 19, 2014 at 23:33
  • 1
    Installing matplotlib via a version of pip built against the system Python will also work. You can also use Homebrew and the homebrew-python tap, as long as the matplotlib formula is not built against Homebrew's Python.
    – dakcarto
    May 19, 2014 at 23:46
2

I ran into the same problem. My matplotlib is installed under /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python. In case anyone is interested, I was able to solve this problem by running this command:

ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python /Library/Python/2.7/site-packages/matplotlib-override

now run the installer and it should work fine and you just saved yourself from installing matplotlib twice! do man ln to understand what the command does.

The problem is not because of your use of python.org python and pip instead of system python, and the different place that libraries are placed in.

It is due to the fact that the installer that is hardcoded to look for matplotlib under /Library/Python/2.7/site-packages/matplotlib-override. Further the installer does not provide user to specify path of matplotlib at time of installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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