0

When I run my program (using visual studio code) in debug mode I get the above mentioned error.

PyQt4 Error ValueError: PyCapsule_GetPointer called with incorrect name

However when I run the code without debugging, also via visual studio code Everything works fine.

When I googled I found this question but there is no mention of debug vs normal mode and therefore I do not directly see the connection.

I use anaconda to control my environments.

user180146
  • 895
  • 2
  • 9
  • 18

1 Answers1

0

I was having the same issue, while I'm not sure if this is the best solution, what worked for me was to uninstall all of my python packages and reinstall everything.

To get all of your packages

pip freeze > requirements.txt

Remove them all at once

pip uninstall -r requirements.txt -y

Or remove one by one (This might be better because you can pick and choose which to uninstall if you want)

pip uninstall -r requirements.txt

Then reinstall PyQt4 using the .whl file and whatever other packages you need again.

This might be overkill, but it worked for me. I had both PyQt4 and PyQt5 installed as well as PyQt5-sip. The issue might be coming from having both the 4 and 5 packages installed? I'm not sure since I didn't try removing the PyQt5 and seeing if that fixed anything.

  • I have both pyqt4 and pyqt5-sip I am trying to remove pyqt5-sip (conda remove pyqt5-sip) but it cannot find the package? I wanted to try that first before I take your nuclear suggestion. Anyone any tips on how to deinstall pyqt5-sip? – user180146 Jul 21 '20 at 07:48
  • I had to use pip uninstall pyqt5-sip. It worked. I am going to accept this answer, but I recommend the less nuclear option of just uninstalling pyqt5-sip :) – user180146 Jul 21 '20 at 08:32