3

I have been stuck on this for a while and I'm not sure if it is a bug or me doing something wrong but I cannot work out how to add Scripts to the processing toolbox in QGIS 3 series.

When I click the Script icon and navigate to "Add script to toolbox" nothing happens. I have looked in my processing options and checked that the directory to the scripts is correct.

Vince
  • 20,017
  • 15
  • 45
  • 64
AWGIS
  • 3,220
  • 1
  • 21
  • 36
  • Are you sure you python file is correct? (ie a valid processing algorithm) What happen if you click "create new script" and then you copy/paste the content of your file? Can you launch it then? – etrimaille Dec 21 '18 at 13:29
  • @Gustry thanks for your comment but I'm not sure I understand fully what you mean? – AWGIS Dec 21 '18 at 13:35
  • 1
    What are you trying to do? Do you have an existing Python Processing script and you would like to add it to the Processing panel? Try to click "Create new script" instead of "Add scripts to toolbox", copy/paste your script and try to run it from there – etrimaille Dec 21 '18 at 13:38
  • Ah I see - well it would appear I have an error with my script so I assume it won't load it if this is the case? – AWGIS Dec 21 '18 at 13:43
  • I have an import error ImportError: cannot import name 'QgsMapLayerRegistry' from 'qgis.core' (C:/PROGRA~1/QGIS3~1.5/apps/qgis-dev/./python\qgis\core__init__.py) – AWGIS Dec 21 '18 at 13:45
  • 1
  • 1
    When copy/paste Python code from QGIS 2 to QGIS 3, keep https://qgis.org/api/api_break.html this page open and ctrl+F and search 'QgsMapLayerRegistry'. It has been removed from QGIS 3. – etrimaille Dec 21 '18 at 14:00
  • @Gustry - feel free to answer this if you want as the comments answered my question. – AWGIS Jan 24 '19 at 13:17

0 Answers0