3

I am trying to use QGIS3.4 by using Emacs (elpy) on Mac OS Mojava. I checked following sources:

  1. https://docs.qgis.org/3.4/pdf/en/QGIS-3.4-PyQGISDeveloperCookbook-en.pdf
  2. http://osgeo-org.1560.x6.nabble.com/Error-importing-qgis-in-python-td4141685.html
  3. Calling QGIS from MacOS python

Then, I use the following code:

import os
import sys
sys.path.append('/Applications/QGIS3.4.app/Contents/Resources/python/')
sys.path.append('/Applications/QGIS3.4.app/Contents/Resources/python/plugins')
sys.path.append('/Applications/QGIS3.4.app/Contents/MacOS/lib')
import qgis.core

But, I got the following result.

ImportError: dlopen(/Applications/QGIS3.4.app/Contents/Resources/python/qgis/_core.so, 2): Library not loaded: @executable_path/../Frameworks/qgis_core.framework/qgis_core
 Referenced from: /Applications/QGIS3.4.app/Contents/Resources/python/qgis/_core.so
 Reason: image not found

Could you help me to resolve this issue?

asked Mar 12, 2020 at 18:22
2
  • Hi, unfortunately i don't have the answer, but i'm having the same troubles. Wondering if you found a solution for this? Commented Jun 3, 2020 at 6:58
  • I don't have an answer yet. But, I think this problem is related to multiple versions of python on my computer. So I tried to uninstall my original python. If so, I can see some progress. But, it does not work still. Commented Jun 4, 2020 at 12:02

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.