Ontheway Posted November 3, 2017 Share Posted November 3, 2017 I have added interpreter " C:\Program Files\Side Effects Software\Houdini 16.0.705\python27\python2.7.exe ". Added paths "C:\Program Files\Side Effects Software\Houdini 16.0.705\houdini\python2.7libs " to pycharm. added "C:\Program Files\Side Effects Software\Houdini 16.0.705\houdini\python2.7libs" to system's PATH variable of win10 but when i type in "from PySide2 import QtWidgets " i get the error message in PyCharm : Unresolved reference 'PySide2' Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted November 4, 2017 Share Posted November 4, 2017 PySide2 libraries are located in ....Houdini 16.0.705\python27\lib\site-packages-ui-forced ... something like that, don't remember exact folder name. Quote Link to comment Share on other sites More sharing options...
Ontheway Posted November 4, 2017 Author Share Posted November 4, 2017 2 hours ago, Stalkerx777 said: PySide2 libraries are located in ....Houdini 16.0.705\python27\lib\site-packages-ui-forced ... something like that, don't remember exact folder name. thank u. it's already included in my external libraries. how to import it without any error. enable auto-completing or suggesting Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted November 4, 2017 Share Posted November 4, 2017 There are some complexities with Qt bindings at present. There are Python2 and Python3 branches, and PySide, PySide2, PyQt4, PyQt5 bindings. Back then when only Python2 and Qt4 existed, everything was simple: you either go with PySide or PyQt4. Now it's more complicated UNLESS you compile the bindings yourself. So If you want PySide2 for Python2 on windows you have to compile it yourself. Same for PyQt5. We are pretty stuck with Python2 for at least until 2020 (see http://www.vfxplatform.com/) Another quick solution is to install Python3 and PyQt5 (pip3 install pyqt5), and then use houtil.Qt wrapper: from hutil.Qt import QtWidgets, QtCore But why do we need to install Python3 and PyQt5 then? Well, just to be able to use PyCharm features! In PyCharm type this: from hutil.Qt import QtWidgets, QtCore if False: from PyQt5 import QtWidgets, QtCore You trick PyCharm to use PyQt5 libraries for autocompletion. It's a very quick and not so reliable solution because PyQt5 and PySide2 are different, as well as Python2 and Python3 Note that you can use https://github.com/mottosso/Qt.py (hutil.Qt is basically the same) which abstracts the bindings problem and your code will use whatever library is available at that time. But you won't have PyCharm completion which is sad. So the take away is: for serious development with PyCharm + Houdini, you want to compile PySide2 bindings. P.S. quite a long post Maybe someone finds it useful. I'm a long time PyCharm user and still haven't found the working solution for Houdini and Qt development that works on all platforms. Quote Link to comment Share on other sites More sharing options...
Ontheway Posted November 5, 2017 Author Share Posted November 5, 2017 7 hours ago, Stalkerx777 said: There are some complexities with Qt bindings at present. There are Python2 and Python3 branches, and PySide, PySide2, PyQt4, PyQt5 bindings. Back then when only Python2 and Qt4 existed, everything was simple: you either go with PySide or PyQt4. Now it's more complicated UNLESS you compile the bindings yourself. So If you want PySide2 for Python2 on windows you have to compile it yourself. Same for PyQt5. We are pretty stuck with Python2 for at least until 2020 (see http://www.vfxplatform.com/) Another quick solution is to install Python3 and PyQt5 (pip3 install pyqt5), and then use houtil.Qt wrapper: from hutil.Qt import QtWidgets, QtCore But why do we need to install Python3 and PyQt5 then? Well, just to be able to use PyCharm features! In PyCharm type this: from hutil.Qt import QtWidgets, QtCore if False: from PyQt5 import QtWidgets, QtCore You trick PyCharm to use PyQt5 libraries for autocompletion. It's a very quick and not so reliable solution because PyQt5 and PySide2 are different, as well as Python2 and Python3 Note that you can use https://github.com/mottosso/Qt.py (hutil.Qt is basically the same) which abstracts the bindings problem and your code will use whatever library is available at that time. But you won't have PyCharm completion which is sad. So the take away is: for serious development with PyCharm + Houdini, you want to compile PySide2 bindings. P.S. quite a long post Maybe someone finds it useful. I'm a long time PyCharm user and still haven't found the working solution for Houdini and Qt development that works on all platforms. thank u. I'll try this.☺ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.