3

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 receive 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.

6
  • Have you checked gis.stackexchange.com/questions/30068/…
    – underdark
    Commented Aug 1, 2012 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
    Commented Aug 1, 2012 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
    Commented Aug 1, 2012 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
    Commented Aug 1, 2012 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
    Commented Aug 1, 2012 at 11:38

0

Your Answer

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

Browse other questions tagged or ask your own question.