New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyQt5 and Anaconda trouble #138
Comments
Unless you need them from the same scripts, I would just create a separate conda environment for pyqt5, like |
Ideally, two environments would not be required. One of the appeals of Anaconda (and the main one for me) is its clean, batteries-included package system. These workarounds diminish the advantage to the point where it may be cleaner to just use Chris Gohlke's Windows installers, or Ubuntu packages. |
Unless you can install both pyqt4 and pyqt5 in the same environment, you will have to have separate environments. Anaconda comes with things that require pyqt4, like the ipython qtconsole and spyder. |
I installed PySide. It's coexisting with PyQt5. Anaconda's Ipython and Spyder now work properly. Anaconda's Matplotlib still doesn't: It seems to require PyQt4. Ipython and Spyder appear to work with PyQt4 or Pyside. |
Sure, but we have already decided to use pyqt instead of pyside by default in Anaconda. |
Got it working on Ubuntu cleanly. This indeed comes down to PyQt's caveat "Unfortunately it is not possible to use both the PyQt4 and PyQt5 installers at the same time. If you wish to have both PyQt4 and PyQt5 installed at the same time you will need to build them yourself from the source packages." Solution: 'conda remove sip'. Install sip 4.16 from source. Install PyQt5 from source. Everything works. |
I've been working on Qt5/sip/PyQt5 conda packages that is installable alongside Qt4/PyQt4 (http://binstar.org/dsdale24), but there is are two issues with the existing pyqt conda package on windows.
I can get pyqt and pyqt5 installed side-by-side on windows by installing in the following order (assumes pyqt, qt5, sip, pyqt5 are not already installed):
But if I then do |
By the way, the issues I mentioned should be easy to address. Just tweak the pyqt recipe to get rid of the qt.conf file, it is not needed, get rid of the sip.pyd file, and have pyqt depend on the sip package. |
I also got trouble using PyQt5 in a conda environment. I did the following steps:
When I tried to import PyQt5.QtWidgets module I got the following error: >>> from PyQt5.QtWidgets import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application I got the whole thing working by copying the Qt directory (c:\miniconda3\Lib\site-packages\PyQt5\Qt) from the root environment to the virtual environment. Still I' m not happy with this solution. Does somebody know a better way? |
@MrLeeH, we still don't have official packages for PyQt5, so I don't know where you get them. |
I don't know where those packages are coming from. Please contact the author and talk to him/her about the problems you're having :-) |
Alright thanks, I' ll do this. Is there going to be an official PyQt5 support in the future? |
Yes, please use https://anaconda.org/qttesting channel to test. |
@mingwandroid Thanks for this tipp. I tried the pyqt package from https://anaconda.org/qttesting and it works out of the box. Why is it still declared as testing? |
Because we haven't moved them to our main channels :-) Sorry for not mentioning those packages, but we're working on the last details before announcing them publicly. |
@ccordoba12, I figured that by mentioning them we'd get some extra testing, apologies if you'd rather I didn't. |
@mingwandroid, no problem if you take the bullets for problems about them ;-) I don't have time to give them support right now. |
So this finally seems to work. Maybe this issue should be closed. Just installed PyQt5 from the default channel. |
pip install PyQt5 ::: After struggling 2 hrs, finally, this worked for me. Just wanted to share. |
conda install -c dsdale24 pyqt5 Try this one . It works for me . |
Im having this issue on a virgin anaconda install. Im playing around with PyQt5. When i run the following in Spyder it works. When i run it in Visual Studio i get the following error Is there a definitive fix for this? |
@DaveDave9994, did you activate your environment before launching Sypder? You may have run into local packages causing problems. Perhaps try |
I have uninstalled and made sure that anaconda is the only package for python. C:\Users\antho\Anaconda3 if i Im thinking of getting rid on anaconda and doing a straight Python3.7 install. |
Please see https://www.anaconda.com/blog/developer-blog/who-you-gonna-call-halloween-tips-treats-to-protect-you-from-ghosts-gremlins-and-software-vulnerabilities/ for more potential causes and remedies. |
It's |
The fact that this issue has been causing problems since 2014 and I'm having it in 2019 makes me think Anaconda is not worth it. |
@Runekeon, I hope you find what you are looking for, good luck! |
tried all of the solutions above, still facing the same issue: the moment I install pyqtgraph (latest version) or update PyQT, anaconda stops working !! |
Qt doesn't like having multiple versions installed at the same time: 'RuntimeError: the PyQt4.QtCore and PyQt5.QtCore modules both wrap the QObject class', after installing PyQt5 with Anaconda.
I got Qt5 working using 'conda remove PyQt', followed by 'f'[orce] . This must be done before installing PyQt5, since it removes sip. Also had to 'conda remove matplotlib' with a force, and reinstall it from the LFCI packages website. Ipython GUI and Spyder too. (Haven't found a workaround like this for Linux yet)
Is there a way to have PyQt 4 and 5 installed at the same time Anaconda? I'd like to be able to use PyQt5 without breaking Spyder, Matplotlib and IPython.
The text was updated successfully, but these errors were encountered: