Comments (13)
I just added the following to all relevant files in the repository:
try:
from PyQt4 import QtGui, QtCore
except ImportError:
from PyQt5 import QtGui, QtCore # untested
However, I have no idea if this will be sufficient or if the syntax has changed between PyQt5 and PyQt4 - and can not test it myself. If you could try it and report the result, it would be appreciated.
from easygui_qt.
I get this on Windows:
Traceback (most recent call last):
File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\easygui_qt.py", line 24, in <module>
from . import utils
File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\utils.py", line 125, in <module>
class MyPageDialog(QtGui.QDialog):
AttributeError: 'module' object has no attribute 'QDialog'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Documents\dev\python\thorsten\cyrillic.py", line 11, in <module>
import easygui_qt
File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\__init__.py", line 6, in <module>
from .easygui_qt import *
File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\easygui_qt.py", line 31, in <module>
import utils
ImportError: No module named 'utils'
from easygui_qt.
The second error puzzles me... that being said: did you import it from PyPi? I have not created a new version. I was just suggesting to try from the current repository - by cloning it.
That being said: it looks like PyQt5 has changed the modules structure (no attribute 'QDialog') which I can not test from here.
I'll keep this issue open, in case I find a way (and the time) to support both PyQt4 and PyQt5.
Sorry that I can not be more helpful at this time.
from easygui_qt.
You may look at what spider-ide folks are doing
from easygui_qt.
QtPy ? https://github.com/goanpeca/QtPy
from easygui_qt.
(today) yes.
from easygui_qt.
I don't have any time to spend on this project at the moment; I'm open to pull requests (or feel free to fork it, of course).
from easygui_qt.
I cannot test qt4 but I forked this repository in order to adapt it to qt5 without backward compatibility with qt4.
https://github.com/uvchik/easygui_qt5
from easygui_qt.
I probably should have closed this issue : the latest version should now be compatible with qt5. (One problem: the automated tests no longer work.)
from easygui_qt.
What do mean with the latest version
?
For me get_file_names()
dids not work with pyqt5. I had to change it according to the following page:
http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#qfiledialog
- files = qt_widgets.QFileDialog.getOpenFileNames(None, title, os.getcwd(),
- "All Files (*.*)", options)
+ files = qt_widgets.QFileDialog.getOpenFileNames(None, title, os.getcwd(),
+ , "", "All Files (*.*)", options)
from easygui_qt.
By latest version, I refer to the last commit made on December 25, 2017, based on some input by a user who contacted me.
Based on what you found, obviously there is at least one bug in existing version. It is obvious that I did not test it as fully as I should have.
from easygui_qt.
I could make a PR but I am not sure if my changes work on pyqt4.
from easygui_qt.
I understand ... it would likely need and if/else
statement to work reliably with both versions.
I think you are better off continuing with your fork - and I will leave this issue open as a warning for anyone interested in a qt5 compatible version. This project is at the bottom of my priority list (I started it for fun, as a means to learn qt) and I cannot give it the prompt attention it deserves.
from easygui_qt.
Related Issues (20)
- tests under python 2.7 HOT 5
- Add optional argument handling to _launch_widget.py HOT 1
- Roadmap: widget to implement (and other added functionality) HOT 6
- hidden window problem HOT 5
- persistent unresponsive window (python 2.7.8) HOT 5
- cannot find suitable PyQt installation HOT 2
- A simple question with matplotlib plot window HOT 5
- Bug with multichoice selector
- get_date returns string instead of datetime.date HOT 4
- ModuleNotFoundError HOT 5
- Press "Cancel" on get_yes_or_no return False, not None.
- get_many_strings() return orderDict,which is not good for use
- Need buttonbox window
- easygui_qt.demos "Error importing PyQt5" HOT 3
- error message in get_file_names HOT 6
- Save settings in local file
- issue with get_file_names(), get_save_file_name() HOT 2
- Problems remaining with unicode handling for Python 2.7 HOT 2
- python 2.7 subprocess issues (affects launcher demo) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easygui_qt.