KnowZero / Krita-PythonPluginDeveloperTools

Python plugin for Krita that assists with making python plugins for Krita
48 stars 2 forks source link

IndexError opening Krita API tab #2

Closed Diamondtroller closed 1 year ago

Diamondtroller commented 1 year ago

When I open Krita API tab for the first time of docker being active, it displays this error and Export API AutoComplete button doesn't seem to work.

Python 3.10.9 Krita 5.1.3

KnowZero commented 1 year ago

Is there any reason why you are on older 5.1.3 instead of latest 5.1.5? Also, which version are you using, store, appimage, flatpak? (I'm guessing you are on linux based on the structure)

Also, do you get a message asking if you would like to download latest data online when going to Krita API. It gives instructions for getting the API manually. See if that makes it work

Diamondtroller commented 1 year ago

Hello, I want to apologize for the long wait.

  1. I switched to a new Linux distro and didn't realize I wasn't on latest release. Now I updated the same error.
  2. I am on NixOS which uses nixpkgs, here's the link to krita package. It should work just like a plain binary.
  3. I get the option of installing the corresponding Krita API version using your plugin when it downloads it shows the error. I'll try out cloning it myself and will write back.
KnowZero commented 1 year ago

I just in case tested a fresh appimage install(using .home director method) on Linux Mint and Tumbleweed, and there is no issue. I do see it didn't work on Leap (but errors only on terminal due to Python 3.6 urlib ssl certificates being outdated, but since 3.6 is discontinued there is little reason to do a workaround for it and one can fix it by updating their ssl certificates)

You can also try the appimage and see if it works or if its just a nixos specific packaging issue

Diamondtroller commented 1 year ago

I just tried the plugin on my other computer with Manjaro, where I have installed Krita from Manjaro packages (Python 3.11.3, Krita 5.1.5). I get the same error with both automatic and manual installation methods.

But then I tried installing with AppImage and voilà, the IndexError is gone. I ran this in Scripter

import sys
print(sys.version)

And it prints that AppImage uses 3.8.1 [GCC 11.1.0] instead of my Manjaro system's 3.11.3 [GCC 13.1.1] or my NixOS system's 3.10.12 [GCC 12.2.0] I got the error.

I wanted to confirm it's something to do with versions and so on NixOS I recompiled Krita to use python 3.9 and error in plugin was gone. The version reported in Scripter here was 3.9.17 [GCC 12.2.0].

I am not sure if this is a python version's problem? Doing pip list on both 3.9 and 3.10 nix environments shows the same package versions for pyqt5, sip and pyqt5-sip.

KnowZero commented 1 year ago

The issue was Python 3.10+, I was even able to replicate it in the 5.2 alpha appimages which upgraded python version. I did a fix, see if it works fine now

Diamondtroller commented 1 year ago

Awesome. I can confirm it works on my machine now too. Thank you!