Debugging Qt application
I am trying to debug an application that uses a Qt framework (enaml) which uses Qt API version 2.
Once the debugging session starts I get the following error:
"ValueError: API 'QDate' has already been set to version 1"
The application runs correctly when lunched from the command line.
My guess is that wingide already sets the API version. Is it possible to change this behavior (I cannot change the API version that my application uses)?
I am not using pyinstaller.
The problem occurs when matplotlib is imported before enaml (the qt framework I am using). The work around is to import enaml before matplotlib.
I compared both setups (command line and wingide). The only difference I found was that wingide injects the following environment variables:
Are you possibly using PyInstaller or something else that might account for this? Maybe the work-around described in https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version will solve it?
Wing uses PyQt itself but other than possibly leaking an environment variable your debug process should not be in any way affected by this, since it runs in a separate process space. I checked this just now and don't see any environment variable set that I think could cause this, so I am guessing that it's some other cause, but still worth a check by looking at os.environ in each case.
Also take a look at compare sys.executable and sys.path to make sure the same are being used in each case. You can alter those by setting/adding values in Project Properties. If sys.executable is wrong, set that into Python Executable. To add things to sys.path put them in Python Path.