问题
I had EPD installed and am giving Canopy (Windows 7 64-bit, Academic license) a go. When I first started Canopy, nothing happened (no GUI, no error message) and I realized this is because I had QT_API set to pyqt. Changing qt_api to pyside allows me to start Canopy. After doing this I have checked that pyqt is installed through the Canopy package manager. However Canopy refuses to start with QT_API set to pyqt. How can I fix this? I have a big project with everything in pyqt, so I want to use it.
回答1:
Since Canopy GUI application runs in a different process than Canopy User Python, they can use different GUI backends.
At present, the Canopy GUI application is Pyside-only, because of PyQt's GPL license. I think, therefore, that Canopy GUI should be ignoring QT_API (or internally forcing it), so that you could set it however you want for your application. However from your report this does not seem to be the case.
As a workaround, the first thing that I would try would be to begin your main module (before any backend-dependent imports) by setting os.environ['QT_API'] = 'pyqt'
.
来源:https://stackoverflow.com/questions/19001693/how-can-i-use-pyqt-with-enthought-canopy