arminstraub / krop

A simple graphical tool to crop the pages of PDF files, written in Python/Qt
http://arminstraub.com/software/krop
GNU General Public License v3.0
122 stars 13 forks source link

ValueError: PyCapsule_GetPointer called with incorrect name #24

Closed arkonbob closed 4 years ago

arkonbob commented 4 years ago

Whenever I try to run either the Ubuntu Universe packaged version of the app or the snap version in Lubuntu 19.10, I receive the following error:

ValueError: PyCapsule_GetPointer called with incorrect name

The error described here:

https://github.com/leo-editor/leo-editor/issues/1106

... was similar, so I tried applying the fix there to the latest code from the git repo (without a full understanding of the issue). I have added the following to vieweritem.py at line 25:

except ValueError: QtWebKitWidgets = None

I then ran:

python3 setup.py build
sudo python3 setup.py install

Krop now runs for me.

arkonbob commented 4 years ago

Spoke too soon... Krop runs but it seems there are still issues with the Poppler library, so I can't actually open any PDFs.

arminstraub commented 4 years ago

Thank you for bringing this up! Since the command from popplerqt5 import Poppler is what causes that error for you this means that, as you observed, the Poppler library on your system has an issue. Your workaround works to start krop but it doesn't solve the underlying issue because Poppler is required for krop to do its work.

Fortunately, you should be able to upgrade that library: at least Ubuntu 20.04 does not appear to have the issue you describe (I have just setup a Kubuntu 20.04 system and installed krop successfully; however, because of another issue, this requires using the current krop code from github or waiting for the 0.5.2 release which I hope to complete soon).