Pip cannot fetch a modern version of gmic-py on python 3.10 as only 3.9 wheels exist and pypi doesn't have the source for newer versions.

I’m trying to copy this part of the tutorial in order to load in Images from a file in a way I can do some logic with them before feeding them to g’mic, however despite the cope being 1 for 1 copies from the tutorial it errors in such a way that it suggests the code does not exist. What is the correct syntax for this code?

inputImg = gmic.GmicImage.from_PIL(Image.open(sys.argv[1] + "noise/" + entry.name))

the error in question:

AttributeError: module 'gmic' has no attribute 'GmicImage'

Calling @myselfhimself for this.

Looking deeper, it seems pip on linux has decided to, for whatever reason, install gimic-py 0.0.2. as the current latest is 2.9.2, this is not a good thing. will see if i can get it to recognise it needs to update.

EDIT: it seems that pip is not finding the latest versions of gmic-py, even though pycharm is.

Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement gmic==2.9.2 (from versions: 0.0.1, 0.0.2, 2.8.0.dev1, 2.8.0.dev4, 2.8.1.dev0, 2.8.1.dev1, 2.8.1.dev2, 2.8.1.dev3, 2.8.1.dev5, 2.8.1.dev6, 2.8.1.dev7)
ERROR: No matching distribution found for gmic==2.9.2

Attempting to install 2.8.1.dev7 gives me a build error

        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-n643yxrx/gmic_6ddddbbcd61240f2898a0b3aea1927fd/setup.py", line 9, in <module>
          import pkgconfig
      ModuleNotFoundError: No module named 'pkgconfig'

Not sure what specifically is missing as I had to install the compilation requirements to even get 0.0.2 to install

EDIT 2:
Doing some additional digging I found that the issue seems to be that, with python 3.10’s release, all the 3.9 wheels are for an incorrect platform, so pip only gets the versions that have source, all of which are marked as pre-release except 0.0.2 and 0.0.1, so pip installs 0.0.2.

Editing my title to reflect the real problem.

EDIT 3: found my pkgconfig problem, turns out it was a thing I needed pip to install, which is why trying it in my package manager went nowhere. managed to get 2.8.1.dev7 to install now, but get a new error implying that this is too old for Pillow support. AttributeError: type object 'gmic.GmicImage' has no attribute 'from_PIL'