Closed jordanlui closed 6 years ago
Did you use pip to install pyqt5 at some point?
@ccordoba12 Almost positive that I have not done pip install of pyqt5 To test my issues, I wiped my Anaconda install and started fresh, and then started creating environments and seeing my errors arise. So conda list shows pyqt 5.6.0 for python build py36_2.
Should I try a pip install now?
Thanks,
Note I do have a completely separate (non-anaconda) Python 3 install on my machine which has QtPy 1.3.1 installed via pip, but pyqt is not listed. I hope this isn't adding to my issues.
Should I try a pip install now?
No, that's a sure way to break your Anaconda install.
Make sure you are launching Spyder from the Anaconda prompt or Anaconda Navigator; launching from the normal command prompt or Git Bash will use your system Python version which will not work with Spyder since it won't have the right compiled packages installed (like PyQt, which is why you're likely seeing the PySide error as a fallback). PySide
hasn't been supported by Spyder for a long time; 3.3
will move to PyQt5 only for the time being.
In any case it looks like it can't find your Qt bindings; Spyder thinks you have Qt/PyQt 5.9.x installed which could also pose a problem since we don't officially support it yet I believe. In any case, unless user error is involved somewhere most likely something's amiss with your Anaconda install, in which case a clean reinstall is the most reliable solution. Other than that, please try the steps listed in the Spyder Troubleshooting Guide, specifically the Basic First Aid and Emergency CPR sections, which resolve the great majority of Spyder installation issues.
Thanks for response! I should have clarified: my launches from Win Cmd Prompt or Git Bash are within an activated anaconda environment - so they should target my specific env that I am having trouble with.
Also: My recent attempts have been with a fresh install of Anaconda.
I tried all tips in troubleshoot guide that I can easily test now, including updating spyder and anaconda.
I'm going to to wipe my Anaconda2 and install Anaconda3 instead, and see if my issues persist.
Thanks, Jordan
I should have clarified: my launches from Win Cmd Prompt or Git Bash are within an activated anaconda environment
Okay, so you set up your $PATH$, , environment variables, etc. accordingly?
I'm going to to wipe my Anaconda2 and install Anaconda3 instead, and see if my issues persist.
I don't regularly do so thus I can't comment specifically, but I have seen statements to the effect that running Python 3 and Spyder in an Anaconda2 environment can cause problems generally...
so they should target my specific env that I am having trouble with.
Oh, so it is a specific environment? Can you isolate the problem to any specific packages in that environment? Did you try creating a clean one with just Spyder?
Other than that, anything specific to your setup in terms of packages, etc. installed?
Also, could you try downgrading to Qt/PyQt 5.6 and seeing if the problems persist?
Hi Cam, I setup PATH and Environment variables for my base install (and also tried inserting for my additional anaconda environment, but this hasn't fixed my issues.
Yes I was having issues getting spyder in anaconda2 with any non-base python3 environments. I did an entire clean install of anaconda2 to replicate my issues and they still persisted. I only ran following commands and encountered issues above. Thus I don't think my issues are coming from specific packages that I decided to install.
activate mypy3
conda install spyder
Throughout this period I can get spyder working for my base python2.7 install.
On the flipside, I wiped my anaconda2 install and switched to anaconda3.
I can now get Spyder to launch from Win Start menu or Anaconda Nav, but not from Win Cmd, Git Bash, or Anaconda Prompt.
Now I create a virtual env with Python 2. I get the whole flipped situation: I now have Qt problems in this new environment. I cannot open Spyder by any method.
Is it feasible to maintain separate installs of ananconda2 and anaconda3? It's looking like my only option to having working py2 and py3 spyder instances working successfully.
I checked my Qt versions. All versions are 5.6.x era and I'm still having issues. Both my base Py3 env and my other Py2 env are running PyQt 5.6.0 and qt 5.6.2. Py2 is running qtpy 1.4.0 and Py3 is running qtpy 1.3.1
File "C:\Users\Jordan\Anaconda3\envs\mypy2\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\Jordan\Anaconda3\envs\mypy2\lib\site-packages\spyder\app\start.py", line 159, in main
from spyder.app import mainwindow
File "C:\Users\Jordan\Anaconda3\envs\mypy2\lib\site-packages\spyder\app\mainwindow.py", line 49, in
requirements.check_qt()
File "C:\Users\Jordan\Anaconda3\envs\mypy2\lib\site-packages\spyder\requirements.py", line 39, in check_qt
import qtpy
File "C:\Users\Jordan\Anaconda3\envs\mypy2\lib\site-packages\qtpy\__init__.py", line 169, in
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
One other idea I tried: forcing installation of Spyder at outset of env creation
I tried conda create -n myenv spyder python=2.7
Seem to get identical error:
File "C:\Users\Jordan\Anaconda3\envs\testpy2\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\Jordan\Anaconda3\envs\testpy2\lib\site-packages\spyder\app\start.py", line 159, in main
from spyder.app import mainwindow
File "C:\Users\Jordan\Anaconda3\envs\testpy2\lib\site-packages\spyder\app\mainwindow.py", line 49, in
requirements.check_qt()
File "C:\Users\Jordan\Anaconda3\envs\testpy2\lib\site-packages\spyder\requirements.py", line 39, in check_qt
import qtpy
File "C:\Users\Jordan\Anaconda3\envs\testpy2\lib\site-packages\qtpy\__init__.py", line 169, in
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
Found resolution to my issue, and going to close this now. I am really sorry if I've wasted a lot of people's time.
Issue resolution in my case has to do with Win10 Administrator problems - even though I am sole admin on my laptop.
In my newest fresh install of Anaconda3, I could launch Spyder via Win Start Menu with its default settings, without needing to run as admin.
I now found I can launch Spyder for my secondary Py2 env by opening via Win Start Menu and running as Admin. I can also launch Spyder for my secondary Py2 env by running Win Cmd as admin, activating env, and then running Spyder. The Qt errors don't show up when I elevate.
This seems to be a recurring issues in my Win10 installs but I somehow couldn't mouse this out in my prior Anaconda2 install where I had Py2 base and Py3 in a secondary env.
Thanks for all the guidance!
Interesting. I've installed Anaconda3 and launched Spyder by both shortcut and Anaconda Prompt in both Py2 and Py3 in Anaconda3 on both Win 8.1 and Win 10, both for all users and for my own admin and non-admin account, and never run into this problem without any elevation, Not sure exactly what would be different about your situation, but good to have another datapoint. Also, the Troubleshooting guide does mention installing by different means (admin and not), starting by different means (shortcut, Navigator, command line, etc) and elevating/running as administrator.
@skykryst FYI, this is a closed issue from nearly a year ago, and Spyder currently only officially supports PyQt5 (the SO question you link is only about a problem with PySide), at least until the PySide/QtfP 5.12 ecosystem matures and Qt 5.12 LTS is available as a conda
package; therefore, its not really a Spyder-relevant problem.
I managed to solve that as follow: 1- Run this on Anaconda prompt : conda install -c anaconda pyqt 2 - Uninstall and install Spyder through Anaconda navigator.
Glad you got your problem resolved. However, do not that as I state in the comment directly above yours, this is unlikely to be an identical or even particularly similar problem to the one reported in the OP. The correct procedure to do all of this should be simply conda install --force-reinstall pyqt qt qtpy spyder
from the Anaconda prompt.
conda install -c anaconda pyqt
The anaconda
channel is just a mirror of the defaults
AD channel; therefore the packages you are getting from it are no different from defaults
. Therefore, it is equivalent to doing conda install --force-reinstall -c defaults pyqt
, with -c defaults
only being necessary if you've mixed around packages from other channels into your environment (which could certainly be a cause of the problem).
Uninstall and install Spyder through Anaconda navigator.
This is no different than doing conda install --force-reinstall -c defaults spyder
from the Anaconda prompt you were just using in the last command, except with the added potential for problems due to bugs in Navigator (which appear to be quite frequent).
I have the same issue. As you suggested, I ran:
conda install --force-reinstall pyqt qt qtpy spyder
But I still get the error when running spyder:
Traceback (most recent call last): File "C:\Users\I328807\AppData\Local\Continuum\Anaconda3\lib\site-packages\qtpy__init.py", line 199, in
from PySide import version__ as PYSIDE_VERSION # analysis:ignore ModuleNotFoundError: No module named 'PySide'During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\I328807\AppData\Local\Continuum\Anaconda3\Scripts\spyder-script.py", line 10, in
sys.exit(main()) File "C:\Users\I328807\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\app\start.py", line 200, in main from spyder.app import mainwindow File "C:\Users\I328807\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 48, in requirements.check_qt() File "C:\Users\I328807\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\requirements.py", line 41, in check_qt import qtpy File "C:\Users\I328807\AppData\Local\Continuum\Anaconda3\lib\site-packages\qtpy__init__.py", line 205, in raise PythonQtError('No Qt bindings could be found') qtpy.PythonQtError: No Qt bindings could be found
@Mark531 Sorry you're seeing an error; I suspect something is going on with your environment. Open Anaconda prompt in the environment in which you tried to open Spyder, type spyder
, and confirm you again see the above traceback. Then, assuming you still have the error, post the full ouptut of conda list --show-channel-urls
inside a <details>
literal block, like this (you can quote my post to see how to do it):
@CAM-Gerlach Thanks for your help. But in the meanwhile, I managed to fix the issue by running commands suggested by a guy on stackoverflow:
pip install msgpack conda install qt=5.6 pyqt=5.6 sip=4.18
Now, spyder opens without problem.
@Mark531 , I certainly hope you didn't run those commands (or any commands suggested by a random person on SO) in your base
(default) Anaconda environment (especially anything involving pip
or conda-forge
) rather than a separate isolated one, as you stand a good chance of causing problems with your entire Anaconda install if you run commands there without fully understanding what they do. This is why I wanted to look at your environment to determine what the problem was before blindly suggesting possibilities.
pip install msgpack
Almost certainly irrelevant to the problem; msgpack
is not a Spyder dependency and likely to cause issues with anything that does use it, as you installed it from pip
rather than conda
. pip
might have installed further dependencies as well so there's no telling what future problems this might cause.
conda install qt=5.6 pyqt=5.6 sip=4.18
This installs the old 5.6.x versions of Qt/PyQt; you should upgrade to the 5.9.x versions with conda install pyqt=5.9
. If the problem re-occurs, then at least you've isolated the apparent actual cause and you can just downgrade again with conda install pyqt=5.6
; otherwise, you'll be using a more recent version of Qt (at some point, support for 5.6 will be dropped in Anaconda). Thanks.
I guess the guy precisely suggested to downgrade the version of pyqt because a later version was not fully supported. And this is the case indeed. I updated pyqt with your command:
conda install pyqt=5.9
And I get back the error when I try to run spyder:
Traceback (most recent call last): File "C:\Users\I328807\AppData\Local\Continuum\Anaconda3\lib\site-packages\qtpy__init.py", line 199, in
from PySide import version__ as PYSIDE_VERSION # analysis:ignore ModuleNotFoundError: No module named 'PySide'
I guess the guy precisely suggested to downgrade the version of pyqt because a later version was not fully supported.
Yes indeed, occasionally some systems have problems with one Qt version or the other, bt that usually comes down to issues with their GPU, graphics driver or occasionally other installed software, and usually result in a segfault or other cryptic error rather than the one above (which indicates QtPy isn't able to find any Qt bindings at all). Any reasonably recent version of Spyder and QtPy fully supports both versions, so either the versions on your machine are out of date, something else in your Anaconda environment is causing issues, or perhaps there's some other sort of machine-specific issue. If you share your conda list --show-channel-urls
output, I can at least let you know how to fix one of the first two so they don't cause problems in the future (since Qt 5.6 won't be supported forever).
Sure, here is the list of the packages in my current environment:
@Mark531 Thanks. I enclosed it in details tags and a verbatim block for as I requested; since without that it takes up a huge amount of space in the thread and is very difficult to read.
In any case, your issue is immediately apparent: you have installed a large number of packages in your environment via pip
, while others are installed from conda-forge
, and still others from defaults
; furthermore, many of the pip
versions are years and years old, such as Spyder 3.0.0 (current is 3.3.3, with Spyder 4 in beta); 3.0.0 is over 2 1/2 years old) and QtPy 1.1.x. Needless to say, mixing packages from all three sources, and both ancient and up to date versions, is a recipe for unmitigated disaster; I'm honestly surprised Spyder even launched at all. The reason it worked with Qt 5.6 but not with 5.9 was due to Spyder only being fully compatible with the latter as of like 3.2.8 or 3.3.0 (or thereabouts), whereas that ancient version apparently still happened to work with 5.6. Without drastic action, you are likely to have numerous problems in the future trying to use, update and install other packages, as well as Spyder itself, and we of course cannot support a version that far out of date.
In any case, assuming that's your base
environment (the one activated by default opening Anaconda prompt), I would honestly recommend just completely uninstalling Anaconda and doing a clean install, since the environment is so heavily contaminated. Then, use Spyder from base
but create fresh, isolated environments if you need to install conda-forge
or pip
packages, so they don't mess with your Spyder install nor Anaconda itself and if something goes wrong, you can easily fix, remove or recreate just that one environment rather than your whole Anaconda install. Check out our guide to working with packages and envronments with Spyder for more on that. Thanks, and best of luck!
This error means that you installed pyqt5 with pip along side the pyqt conda package. It could be solved by you uninstalling the pip package. Try: pip uninstall PyQt5 Then update conda: conda update conda conda update anaconda-navigator
It will surely resolve your problem
We appreciate you trying to help and share something that worked for you on a superficially similar error, but if you are going to post a potential solution, please do so on an open, non-duplicate issue and take care to read the actual issue report, as in both these cases the issue was not caused by the same problem and would not be fixed by your solution, and furthermore was already resolved and closed. Thanks.
This error means that you installed pyqt5 with pip along side the pyqt conda package.
This is but one of many potential causes of this error, the reporter explicitly stated that they have not used pip
to install PyQt5 at any point, so it of course cannot be the case here, There are many other cases of this error as well which your suggestion will not surely resolve your problem
.
conda update conda
Not explicitly necessary, but doesn't hurt.
conda update anaconda-navigator
The Anaconda Navigator GUI doesn't have anything to do with this; I'm not sure why you're suggesting it.
The above is also missing a crucial step for many if not most such cases, which is ensuring the conda
PyQt package is installed properly: conda install --force-reinstall pyqt qt
.
Sure, I have installed packaged from various sources because default conda channels did not contain the latest versions.
So, I installed a fresh version of Anaconda, but since it was not available for python 3.6 (I use a library that only works in python 3.6), I created a virtual environment. After activating it and running spyder, the interpreter was yet python 3.7... I had to manually change the interpreter. Well, it would be simpler to make available an Anaconda installer for python 3.6.
I have installed packaged from various sources because default conda channels did not contain the latest versions.
Well, your pip
-installed package versions were uniformly, in every case I checked (over a dozen off the top of my head), several years out of date; in many cases installed simultaneously (a sure recipe for disaster) with far newer conda
-installed versions.
Sometime conda defaults
can lag a few days to a week or so behind the latest pip
releases, but unless you absolutely, positively have to get a fix a few days early, I strongly recommend not doing that. And if you do, always do it in an isolated Conda environment (not a virtualenv/venv, if you're using conda), and install from conda-forge
instead of pip
, since it has pretty much all the major and scientific-related packages.
I created a virtual environment
You should never use virtualenvs in conda (although they do reputedly work). You should always use Conda environments instead, as they provide numerous benefits and avoid problems.
So, I installed a fresh version of Anaconda, but since it was not available for python 3.6
It is, it just doesn't come in the default installer. You have two easy options to resolve this: First, you can just run conda install python=3.6
in your base
environment, to switch everything to Python 3.6. Or, as you did, you can create a conda
environment and install the packages you need there, including the one that is still stuck on 3.6, and it will automatically pick up the correct Python version: conda create -n your-new-env-name numpy pandas matplotlib spyder-kernels your-py36-package
. Same thing with any other Python version, like 2.7.
After activating it and running spyder, the interpreter was yet python 3.7... I had to manually change the interpreter.
How, from the command line with spyder
? Or some other way? If the latter, it won't pick up that environment but rather open from base
. However, that's perfectly fine and how its supposed to work, so you don't need to maintain a Spyder install for every environment (or even Python installation) you want to use and can use one copy of Spyder with many environment simultaneously. They just need to have spyder-kernels
installed so Spyder can talk to it. Please read our guide to working with packages and envronments with Spyder for more details about this approach.
Well, it would be simpler to make available an Anaconda installer for python 3.6.
We have no control over this, of course. You are welcome to ask them, but I doubt they'll do so, when users can create a new environment or downgrade the Python version in their base
env with one simple command. Also, you could simply download Miniconda and install exactly the packages and Python version(s) you want, without all the pre-installed baggage.
Hey, CAM-Gerlach Thanks a lot!
After doing these three lines didn´t solve my problem. pip uninstall PyQt5 conda update conda conda update anaconda-navigator
But in addition with: conda install --force-reinstall pyqt qt
solved my problem. I don´t know why it wasn´t properly installed before, but anyway, now it works. Thank you very much! Finally got it running. I almost tried everything before came up to your solution.
We appreciate you trying to help and share something that worked for you on a superficially similar error, but if you are going to post a potential solution, please do so on an open, non-duplicate issue and take care to read the actual issue report, as in both these cases the issue was not caused by the same problem and would not be fixed by your solution, and furthermore was already resolved and closed. Thanks.
This error means that you installed pyqt5 with pip along side the pyqt conda package.
This is but one of many potential causes of this error, the reporter explicitly stated that they have not used
pip
to install PyQt5 at any point, so it of course cannot be the case here, There are many other cases of this error as well which your suggestion will notsurely resolve your problem
.conda update conda
Not explicitly necessary, but doesn't hurt.
conda update anaconda-navigator
The Anaconda Navigator GUI doesn't have anything to do with this; I'm not sure why you're suggesting it.
The above is also missing a crucial step for many if not most such cases, which is ensuring the
conda
PyQt package is installed properly:conda install --force-reinstall pyqt qt
.
After doing these three lines didn´t solve my problem. pip uninstall PyQt5 conda update conda conda update anaconda-navigator
You may either have not had pyqt
and qt
installed, something went wrong with the install, or installing it with pip
as well damaged your conda installation or otherwise messed up your environment. Regardless, glad you got it working!
Thanks a lot for the detailed reply! That makes a lot of sense. The last two reasons fit better. Good to know about those possibilities :)
After doing these three lines didn´t solve my problem. pip uninstall PyQt5 conda update conda conda update anaconda-navigator
You may either have not had
pyqt
andqt
installed, something went wrong with the install, or installing it withpip
as well damaged your conda installation or otherwise messed up your environment. Regardless, glad you got it working!
This error means that you installed pyqt5 with pip along side the pyqt conda package. It could be solved by you uninstalling the pip package. Try: pip uninstall PyQt5 Then update conda: conda update conda conda update anaconda-navigator
It will surely resolve your problem
Thanks, it solved my problem. I ran into this issue several time, when I was installing python on windows over anaconda. :)
Hello everybody. I have problem with my spyder. My spyder does not work. The problem is:
C\: ... envs\kerasgpu\Scripts\spyder-script.py", line 6, in
Can someone help me?
Problem Description
Having issues running Spyder on Python Environments that are not my base environment. In Spyder for Python 3.4, 3.5, 3.6, I can't get Spyder to launch, if I try in Win Cmd Prompt it cites some issue with PySide. I setup environment with Python 3.3 and my Spyder install forced me to upgrade to 3.6. I can get Spyder to work and sometimes run a basic line, but I get cache error messages in terminal when I try to run a script. I don't have problems in my base environment which runs Python 2.7
What steps will reproduce the problem?
4/3
What is the expected output? What do you see instead?
Here is result I see when I launch via Git Bash with Administrator Privileges. These errors appear before I can run a single python command in Spyder.
I can then run some basic commands in Spyder IDE like
4/3
but can't execute scripts.If I launch via Windows Start Menu I get the error but just see the kernel restarting.
However I am unable to install PySide since it appears to require Python 3.3. Should I force a downgrade to Python 3.3 to get this working? Is this safe?
Paste Traceback/Error Below (if applicable)
Package Versions
Dependencies