[Qgis-user] Can't seem to import qgis.core in OSX 10.8

Larry Shaffer larrys at dakotacarto.com
Sat Sep 7 10:44:18 PDT 2013


Hi Nick,

Welcome to using QGIS.

In Terminal, you'll want to set the following:

  export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python

Or, when importing from within a Python module, or at Python console's
prompt in Terminal, you can append that path to the Python executable's
sys.path:

  import sys
  sys.path.append('/Applications/QGIS.app/Contents/Resources/python')

Alternatively, and more to the benefit of understanding PyQGIS, you can use
the Python Console within a running QGIS app, which uses QGIS's embedded
Python executable.

Here are the current docs for the upcoming 2.0 release, though much of it
works fine for 1.8:
http://docs.qgis.org/2.0/html/en/docs/pyqgis_developer_cookbook/

Regards,

Larry


On Sat, Sep 7, 2013 at 11:28 AM, Nick Eubank <nickeubank at gmail.com> wrote:

> Hi All,
>
> I'm very new to qgis (moving over from Arc), and I'm having trouble
> importing qgis 1.8.0.
>
> It seems I'm successfully setting the environment variable correctly to
> "/Applications/QGIS.app/Contents/Resources/python" (I can get it to echo
> back), and when I look in that folder I can see "core.so", but I keep
> getting "*ImportError:* 'No module named qgis.core'".
>
> Any suggestions?
>
> Thanks for helping the noob.
>
> Nick
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130907/25246919/attachment.html>


More information about the Qgis-user mailing list