Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Hi I am trying to access and use QGIS modules/class/methods from IDLE on a mac. I have had the same problem as a few other people, and browsing the forums have tried to follow the advice they have been given.

when typing: import qgis.core

I recieve the msg: ImportError: No module named core

I have tried to set path settings as follows:

export PYTHONPATH=/Applications/QGIS.app/share/python ...and... export LD_LIBRARY_PATH=/Applications/QGIS.app/lib

but I am very new to using command line for the mac and also to python.

I have now spent a couple of hours searching for others' answers that could hopefully help me, but now I am giving up and asking for advice

Thank you in advance

share|improve this question
Have you checked gis.stackexchange.com/questions/30068/… –  underdark Aug 1 '12 at 11:08
yes, I checked this topic and it hasn't helped - I used the different PYTHONPATH and LD_LIBRARY_PATH that he/she uses but it makes no difference. also - i'm using python 2.7.3 whereas he/she is on 2.3? –  Becky Aug 1 '12 at 11:17
Can you show the content of the applicable directories? Something like "ls -l $PYTHONPATH" and "ls -l $LD_LIBRARY_PATH" may help –  BradHards Aug 1 '12 at 11:24
visit060: ls -l $PYTHONPATH total 544 drwxr-xr-x 19 root admin 646 20 Mar 14:23 PyQt4 drwxr-xr-x 7 root admin 238 21 Feb 04:08 plugins drwxr-xr-x 11 root admin 374 21 Feb 04:08 qgis -rwxr-xr-x 1 root admin 107468 11 Feb 20:13 sip.so -rw-r--r-- 1 root admin 91059 11 Feb 20:13 sipconfig.py -rw-r--r-- 1 root admin 72261 20 Mar 14:23 sipconfig.pyc visit060:applications ls -l $LD_LIBRARY_PATH ls: /home/applications/qgis/lib: No such file or directory –  Becky Aug 1 '12 at 11:38
which suggests I don't have the right file (library file) - how would i get this? ...absolutely no clue about this stuff –  Becky Aug 1 '12 at 11:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.