question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with Spyder in Python 3.6

See original GitHub issue

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?

  1. Open Spyder for Python 3.3 via Windows Start Menu, Win Cmd Prompt or Git bash
  2. Run a script or basic line like 4/3
  3. Watch Kernel crash and see error output in terminal

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.

$ spyder
[15764:14556:0409/214138.627:ERROR:cache_util_win.cc(20)] Unable to move the cache: 5
[15764:14556:0409/214138.627:ERROR:cache_util.cc(134)] Unable to move cache folder C:\Users\Jordan\AppData\Local\Spyder\QtWebEngine\Default\GPUCache to C:\Users\Jordan\AppData\Local\Spyder\QtWebEngine\Default\old_GPUCache_000
[15764:14556:0409/214138.627:ERROR:cache_creator.cc(134)] Unable to create cache
[15764:14556:0409/214138.627:ERROR:shader_disk_cache.cc(570)] Shader Cache Creation failed: -2

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.

(py33) C:\Users\Jordan>spyder
Traceback (most recent call last):
  File "C:\Users\Jordan\Anaconda2\envs\py33\lib\site-packages\qtpy\__init__.py", line 163, in <module>
    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\Jordan\Anaconda2\envs\py33\Scripts\spyder-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\Jordan\Anaconda2\envs\py33\lib\site-packages\spyder\app\start.py", line 159, in main
    from spyder.app import mainwindow
  File "C:\Users\Jordan\Anaconda2\envs\py33\lib\site-packages\spyder\app\mainwindow.py", line 49, in <module>
    requirements.check_qt()
  File "C:\Users\Jordan\Anaconda2\envs\py33\lib\site-packages\spyder\requirements.py", line 39, in check_qt
    import qtpy
  File "C:\Users\Jordan\Anaconda2\envs\py33\lib\site-packages\qtpy\__init__.py", line 169, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found

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

  • Spyder: 3.2.8 but listing for version py36_0. Not sure if this is common
  • Python: 3.6.5 (Initially installed Python 3.3, but noticed that Spyder forced this update)
  • Qt: 5.9.4
  • PyQt: 5.9.2
  • Operating System: Win10 64bit

Dependencies

IPython >=4.0    :  6.3.1 (OK)
cython >=0.21    :  None (NOK)
jedi >=0.9.0     :  0.11.1 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
numpy >=1.7      :  1.14.2 (OK)
pandas >=0.13.1  :  None (NOK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.6.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.8.4 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.10.7 (OK)
sphinx >=0.6.6   :  1.7.2 (OK)
sympy >=0.7.3    :  None (NOK)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:29 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
CAM-Gerlachcommented, Mar 9, 2019

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.

2reactions
dberriancommented, Feb 20, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Illnesses — Spyder 5 documentation
If you receive the message An error occurred while starting the kernel in the IPython Console, Spyder was unable to launch a new...
Read more >
Can't install Spyder 4.1.4 after using Python3.6 in Anaconda
I need to open Spyder with Python3.6 because of compatibility issues while trying to import the cv2 module. I'm using Windows 10.
Read more >
spyder - PyPI
Spyder — The Scientific Python Development Environment ... you should always install Spyder via this method to avoid unexpected issues we are unable...
Read more >
Troubleshooting — Anaconda documentation
This may be caused by errors in the Spyder setting and configuration files. Solution¶. Close and relaunch Spyder and see if the problem...
Read more >
spyder-ide/public - Gitter
I'll try to re-install the upgrade to see if the problem returns ... Hi, I installed spyder using pip on a python 3.6...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found