QGIS Python API VSCode

Поділитися
Вставка
  • Опубліковано 29 лис 2024

КОМЕНТАРІ • 22

  • @reynardtorculas1044
    @reynardtorculas1044 Рік тому +4

    Deserve a subscribe mate i was struggling in environment of qgis and vscode and i finally found your video. Great explained please make more video about qgis plugin development. Thank you my problem is solved!

    • @bcodetube
      @bcodetube  Рік тому +2

      I was struggling too, I looked for tutorials and couldn't find any, then I decided to make my own video :)... Unfortunately this is not my main job and I don't expect to make QGIS videos soon, but we never know

  • @MrGregsa
    @MrGregsa Рік тому

    Thanks it helped me. For the tkinter part, in case somebody uses advanced QGIS installer it is possible to select this module and it will be automatically added (and upgraded in future) without manual copying of folders and DLLs

    • @bcodetube
      @bcodetube  Рік тому

      Didn't know about that. Is it something new? Anyway, thank you for the tip

  • @geosursystem
    @geosursystem 2 місяці тому +1

    I LOVE YOU MR!!!

  • @drew173
    @drew173 7 місяців тому +1

    For me importing qgis.core did not work at first even though I followed the steps. somewhow renaming the file worked for me. Or it was closing the command promptand doing it again . idk

  • @luciebernard5800
    @luciebernard5800 Рік тому +1

    Hi, I'm a bit lost. Where do the paths that you paste (8:30 min) come from ? Where did you copy it from ? THank you !

    • @brunorcabral
      @brunorcabral Рік тому +1

      OSGEO_ROOT is the location where you installed QGIS, in my case it is "C:\Program Files\QGIS", it is set when you run the OSGeo4w.bat, the LOCALAPPDATA is from Windows, every user that logs in gets it, it should be something like "C:\Users\yourUser\AppData\Local". I set the PYTHONPATH to use the python installation that comes with QGIS and not the one I have on the system. Let me know if you have more questions

    • @luciebernard5800
      @luciebernard5800 Рік тому

      @@brunorcabral Thank you for your help :)

    • @bcodetube
      @bcodetube  Рік тому

      @@luciebernard5800 I've just realized that I answered with my other UA-cam profile, brunorcabral is me. Let me know if you have more questions

  • @RafaBeerChopeiras
    @RafaBeerChopeiras Рік тому

    me de uma dica, fiz tudo, e a variável py segue como não definida no vscode

    • @bcodetube
      @bcodetube  Рік тому

      Vc abriu o console clicando no "OSGeo4W.bat"?

  • @joelrodriguez1232
    @joelrodriguez1232 Рік тому

    I will give this a Try.

  • @mustaphatitou3662
    @mustaphatitou3662 Рік тому +2

    i think you should find a more pythonic way to make it work

    • @bcodetube
      @bcodetube  Рік тому +1

      can you give one example?

    • @andresingenieroambiental7926
      @andresingenieroambiental7926 Рік тому

      echo "Open System properties";
      start c:\windows\system32\systempropertiesadvanced.exe;
      And put all de PYTHONHOME and PATH

  • @andresingenieroambiental7926

    I have install pyenv in my desktop. and when I put "set py" I got:
    PYENV=C:\Users\Andres\.pyenv\pyenv-win\
    PYENV_HOME=C:\Users\Andres\.pyenv\pyenv-win\
    PYENV_ROOT=C:\Users\Andres\.pyenv\pyenv-win\
    ---
    C:\Program Files\QGIS 3.18> "C:\Microsoft VS Code\Code.exe"

  • @zoltandeveny9599
    @zoltandeveny9599 Рік тому

    I did everything in the video.
    If I run (Shft+Enter) the QGIS python lines line by line, it prints the same lines in Terminal below. But if I run the python script in one run, it prints this:
    File "", line 1
    & C:/PROGRA~1/QGIS32~1.3/bin/python.exe e:/ELTE_TTK_mesterkepzes/3_felev/Terinformatics_problem_solutions/Venyige/eszkoz/proba.py
    ^
    SyntaxError: invalid syntax
    In neither case does it do what is in the program code.

    • @bcodetube
      @bcodetube  Рік тому

      You have a problem in proba.py, looks like you used different python version from when you ran Shift+Enter (are you using Jupyter Notebook?) and when you ran with QGIS. Try to use in the Notebook the same python version as QGIS. If they are the same, you need to check what line is giving you the Syntax Error.