Anaconda 5.1 Python can't see PYQT5 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: Anaconda 5.1 Python can't see PYQT5 (/thread-9933.html) |
Anaconda 5.1 Python can't see PYQT5 - PJ03029174 - May-05-2018 Hi I'm trying to write my first Python GUI application and have installed Anaconda 5.1 (Mac OSX) which includes PYQT5 and Python 3.6. I'm also using the included VS Code as an IDE I'm trying to use the above import statements from the beginning of a tutorial I ‘m following. import sys from PyQt5.QtWidgets import QApplication, QWidgetbut I'm getting an error stating E0611:No name 'QApplication' in module 'PyQt5.QtWidgets' E0611:No name 'QWidget' in module 'PyQt5.QtWidgets' It looks like PYQT5 needs additional configuration to get working as I assume the errors relate to the complier not locating PYQT5. Does anyone know what I can do to clear these errors? Thanks in advance RE: Anaconda 5.1 Python can't see PYQT5 - Larz60+ - May-05-2018 Do you get this error from:
RE: Anaconda 5.1 Python can't see PYQT5 - PJ03029174 - May-05-2018 Hi Larz60+ Just tried your suggestion and it worked fine, no errors running the commands within Terminal. Does that mean its likely a VS Code setup issue? Thanks for the help Pete (May-05-2018, 12:25 PM)Larz60+ Wrote: Do you get this error from: RE: Anaconda 5.1 Python can't see PYQT5 - Larz60+ - May-05-2018 I can't be sure, I run vs code, but only once in a while for working on markdown. How do you launch VS Code? RE: Anaconda 5.1 Python can't see PYQT5 - PJ03029174 - May-05-2018 Hi It seems to be working now??, I started trying multiple versions on Python through VSCode and have returned to "Anaconda, Inc. Python 3.6.4 (base)" and the GUI example is loading now. I'm still seeing the errors though. If it isn't too much trouble, would you mind trying the following code in your version of VSCode to see if you see the same? import sys from PyQt5.QtWidgets import QApplication, QWidget if __name__ == '__main__': app = QApplication(sys.argv) w = QWidget() w.resize(250, 150) w.move(300, 300) w.setWindowTitle('Simple') w.show() sys.exit(app.exec_())Below is what I see [Image: 10z5pfs.png] Thanks Pete RE: Anaconda 5.1 Python can't see PYQT5 - snippsat - May-05-2018 It complain about the same for me in Pylint. Open Command Palette and type pylint Set enable to off ,Pylint check for a lot of stuff that's is not errors(Traceback).It's way to noise to have on all the time, i only turn it on when i have code that want to check for all kind stuff like Coding Standard PEP-8 ect. RE: Anaconda 5.1 Python can't see PYQT5 - PJ03029174 - May-05-2018 Thanks snippsat I just turned it off, I'm only working on a personal project so not too worried about the coding standards. Cheers for the help guys |