3

I am trying to import processing toolbox in my standalone PyQGIS application. But I am in trouble. I follow this instruction: Importing QGIS Processing in stand-alone python script? and this Using QGIS3 Processing algorithms from standalone PyQGIS scripts (outside of GUI)

sys.path.append('/home/' + getuser() + '/.qgis3/python/plugins')
from processing.core.Processing import Processing
Processing.initialize()

But PyCharm doesn't recognize processing still. :/ I suppose it is because of the path, but I don't know where to point anymore. I am using QGIS 3.0 and Linux Ubuntu.

UPDATE: I tried now this path: /home/usrer/.qgis3/python/plugins After that, I got the option to install package, which I run. But after running it, I got the error:

Collecting processing
  Using cached https://files.pythonhosted.org/packages/3b/2d/a6f17cc99d9c45c33eb3eccd6999505d9197b31f0845a845919032262a01/processing-0.52.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pycharm-packaging401/processing/setup.py", line 12
    raise ValueError, 'Versions of Python before 2.4 are not supported'
                    ^
SyntaxError: invalid syntax

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pycharm-packaging401/processing/

And installation failed. And when I try it to install from terminal with: sudo pip3 install processing I get the same error.

0

1 Answer 1

-2

I succeed. I just copy processing folder into script folder and delete line sys.path.append

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.