I have QGIS Valmiera 2.2.0 installed and started a simple python script using this documentation.
I had a hard time because always when I used
from qgis.core import *
I got the message ImportError: No module named qgis.core
. I fixed that with the statement
sys.path.extend([r"C:\Program Files (x86)\QGIS Valmiera\apps\qgis\python"])
using the correct python path. Then I expected it to work but I ran into the next error message:
ImportError: No module named sip
I tried to do the same again, adding subfolders of qgis, which might be connected to sip, but without success.
sys.path.extend([r"C:\Program Files (x86)\QGIS Valmiera\apps\Python27",
r"C:\Program Files (x86)\QGIS Valmiera\apps\Qt4",
r"C:\Program Files (x86)\QGIS Valmiera\apps\Python27\sip",
r"C:\Program Files (x86)\QGIS Valmiera\apps\Python27\sip\PyQt4",
r"C:\Users\Downloads\sip-4.16.7\sip-4.16.7"])
The sip.exe, which I guess it is looking for, is actually located in the C:\Program Files (x86)\QGIS Valmiera\apps\Python27
path.
Is there anything missing in the pre-installed functionality or what might be the problem?
Thanks for any hints!
UPDATE: For anyone interested: I did the following steps for installing sip library, without final success so far:
- Installed pip as described in this tutorial: http://quantumofgis.blogspot.de/2014/11/qgis-standalone-and-python-modules.html
- Tried
pip install sip
giving errorInsecurePlatformWarning
- Tried pip install --allow-external sip giving
You must give at least one requirement to install
- pip install --allow-external "sip>=4.16"
pip install http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.7/sip-4.16.7.zip giving
IOError: [Errno 2] No such file or directory: 'c:\users\user\appdata\local\temp\pip-d92iiw-build\setup.py'
Command "python setup.py egg_info" failed with error code 1 in c:\users\user\appdata\local\temp\pip-d92iiw-build
Tried installing contained configure.py from
pip-d92iiw-build
manually. Also no success