Spyder: Can't open Spyder even after fresh Anaconda install/in new environment

Created on 13 Dec 2017  路  32Comments  路  Source: spyder-ide/spyder

Description of your problem

What steps will reproduce the problem?
I've been having issues starting Spyder due to Qt Bindings. On a fresh anaconda install I've made a new environment, installed spyder and tried to open it with no luck i.e.
conda create --name spydertest

activate spydertest

conda install spyder

spyder

What is the expected output? What do you see instead?
I expected Spyder to launch however instead got the following error message:

Traceback (most recent call last):
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\qtpy\__init__.py", line 148, in <module>
    from PySide import __version__ as PYSIDE_VERSION  # analysis:ignore
ImportError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda3\envs\spydertest\Scripts\spyder-script.py", line 10, in <module>
    sys.exit(main())
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\spyder\app\start.py", line 144, in main
    from spyder.app import mainwindow
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\spyder\app\mainwindow.py", line 49, in <module>
    requirements.check_qt()
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\spyder\requirements.py", line 39, in check_qt
    import qtpy
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\qtpy\__init__.py", line 154, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found

Please provide any additional information below
Conda env:

# packages in environment at D:\Anaconda3\envs\spydertest:
#
alabaster                 0.7.10           py35h3a808de_0
asn1crypto                0.23.0           py35h65de013_0
astroid                   1.5.3            py35h82ecf54_0
babel                     2.5.0            py35hcd66c26_0
bleach                    2.1.1            py35h73b2768_0
ca-certificates           2017.08.26           h94faf87_0
certifi                   2017.11.5        py35h456c6ae_0
cffi                      1.11.2           py35h74ad5ef_0
chardet                   3.0.4            py35h177e1b7_1
colorama                  0.3.9            py35h32a752f_0
cryptography              2.1.4            py35h8ead9e0_0
decorator                 4.1.2            py35hc7d1f2e_0
docutils                  0.14             py35h8ccb97f_0
entrypoints               0.2.3            py35hb91ced9_2
html5lib                  1.0.1            py35h047fa9f_0
icu                       58.2                 ha66f8fd_1
idna                      2.6              py35h8dcb9ae_1
imagesize                 0.7.1            py35h7f87e83_0
ipykernel                 4.7.0            py35h2f9c1c0_0
ipython                   6.2.1            py35h4a2ac14_1
ipython_genutils          0.2.0            py35ha709e79_0
isort                     4.2.15           py35h0bf7b49_0
jedi                      0.11.0                   py35_2
jinja2                    2.10             py35hdf652bb_0
jpeg                      9b                   hb83a4c4_2
jsonschema                2.6.0            py35h27d56d3_0
jupyter_client            5.1.0            py35hcddec19_0
jupyter_core              4.4.0            py35h629ba7f_0
lazy-object-proxy         1.3.1            py35he996729_0
libpng                    1.6.32               h140d38e_4
markupsafe                1.0              py35hc253e08_1
mccabe                    0.6.1            py35hcf31250_1
mistune                   0.8.1            py35h7e79247_0
nbconvert                 5.3.1            py35h98d6c46_0
nbformat                  4.4.0            py35h908c9d9_0
numpydoc                  0.7.0            py35h72ac4f2_0
openssl                   1.0.2n               h74b6da3_0
pandoc                    1.19.2.1             hb2460c7_1
pandocfilters             1.4.2            py35h978f723_1
parso                     0.1.1            py35he39c48a_0
pickleshare               0.7.4            py35h2f9f535_0
pip                       9.0.1            py35h691316f_4
prompt_toolkit            1.0.15           py35h89c7cb4_0
psutil                    5.4.1            py35h5f28cdc_0
pycodestyle               2.3.1            py35h35694a3_0
pycparser                 2.18             py35h15a15da_1
pyflakes                  1.6.0            py35hb7fdafe_0
pygments                  2.2.0            py35h24c0941_0
pylint                    1.7.4            py35h717b2e0_0
pyopenssl                 17.5.0           py35h75c5b16_0
pyqt                      5.6.0            py35hd46907b_5
pysocks                   1.6.7            py35hb30ac0d_1
python                    3.5.4               h1357f44_23
python-dateutil           2.6.1            py35h6b299a3_1
pytz                      2017.3           py35hb294b1a_0
pyzmq                     16.0.3           py35h1861011_0
qt                        5.6.2           vc14h6f8c307_12  [vc14]
qtawesome                 0.4.4            py35h639d0ff_0
qtconsole                 4.3.1            py35hc47b0dd_0
qtpy                      1.3.1            py35h4918c39_0
requests                  2.18.4           py35h54a615f_1
rope                      0.10.7           py35h5756fe0_0
setuptools                36.5.0           py35h21a22e4_0
simplegeneric             0.8.1            py35h6406082_0
sip                       4.18.1           py35h01cbaa7_2
six                       1.11.0           py35hc1da2df_1
snowballstemmer           1.2.1            py35h4c55bfa_0
sphinx                    1.6.3            py35heeac824_0
sphinxcontrib             1.0              py35h45f5ca3_1
sphinxcontrib-websupport  1.0.1            py35ha3690eb_1
spyder                    3.2.4            py35h467e5b4_0
sqlite                    3.20.1               h9eeafa9_2
testpath                  0.3.1            py35h06cf69e_0
tornado                   4.5.2            py35h03246f3_0
traitlets                 4.3.2            py35h09b975b_0
typing                    3.6.2            py35h37628ea_0
urllib3                   1.22             py35h8cc84eb_0
vc                        14                   h2379b0c_2
vs2015_runtime            14.0.25123           hd4c4e62_2
wcwidth                   0.1.7            py35h6e80d8a_0
webencodings              0.5.1            py35h5d527fb_1
wheel                     0.30.0           py35h38a90bc_1
win_inet_pton             1.0.1            py35hbef1270_1
win_unicode_console       0.5              py35h56988b5_0
wincertstore              0.2              py35hfebbdb8_0
wrapt                     1.10.11          py35h54666f7_0
zlib                      1.2.11               h8395fce_2

Versions and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.5.4
  • Qt Version: 5.6.2
  • PyQt Version: 5.6.0
  • Operating system: Windows 10

Most helpful comment

@CAM-Gerlach Thank you very much, it worked for me!
To sum up, this is what I did to resolve the problem:

pip uninstall PyQt5
conda update conda
conda update anaconda-navigator
conda install --force-reinstall pyqt qt

All 32 comments

Did you run python bootstrap.py in your spyder directory first?

I hadn't ,that file wasn't in my directory, but when I downloaded it and ran it I received a similar error

Executing Spyder from source checkout
Revision None, Branch: None
01. Patched sys.path with D:\Anaconda3\envs\spydertest\Lib\site-packages\spyder
02. PyQt5 is detected, selecting
Traceback (most recent call last):
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\qtpy\__init__.py", line 148, in <module>
    from PySide import __version__ as PYSIDE_VERSION  # analysis:ignore
ImportError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\bootstrap.py", line 143, in <module>
    versions = get_versions(reporev=False)
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\spyder\__init__.py", line 67, in get_versions
    import qtpy
  File "D:\Anaconda3\envs\spydertest\lib\site-packages\qtpy\__init__.py", line 154, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found

Ah right. Actually, that was my mistake; you should only need to do so when installing from source which you presumably weren't. The weird thing is that it says it is detecting PyQt, but then looks for PySide and can't find it? Could be cause I misinformed you about bootstrap.py, and it doesn't know what to do with a binary install...no clue. In any case, you have qt and qtpy in the environment, so not sure why its not finding them either way.

The commands you gave should produce the result, but can you create a new env with the Anaconda Navigator GUI (make sure to update it) and install Spyder via that method, to see if it works? I'm rapidly running out of ideas other than brute force methods, since this _should_ work...I just did it myself on Windows, twice.

Please report this in the Anaconda issue repo:

https://github.com/ContinuumIO/anaconda-issues/issues/

I really don't know why this is happening.

I have the same issue with Python 3.6.5, did you open a ticket at Anaconda's site ? (I did not find it immediately). I tried to update PySide as installed via conda but

$ conda install PySide
Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - pyside -> python=2.7
  - python=3.6
Use "conda info <package>" to see the dependencies for each package.

@jfbu, you need to do

conda install pyqt

Thanks for the tip @ccordoba12 but

$ conda install pyqt
Solving environment: done

# All requested packages already installed.

Besides, uninstalling spyder and doing pip install -U spyder gives same situation

$ pip install -U spyder
Collecting spyder
  Downloading https://files.pythonhosted.org/packages/ae/7a/1c05755680d178d786e6bba4041dedca35c3a30805aff40f432e37298ecd/spyder-3.2.8-py3-none-any.whl (3.5MB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 3.5MB 7.5MB/s 
Requirement not upgraded as not directly required: sphinx in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (1.7.4)
Requirement not upgraded as not directly required: pycodestyle in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (2.3.1)
Requirement not upgraded as not directly required: pylint in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (1.8.4)
Requirement not upgraded as not directly required: pickleshare in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (0.7.4)
Requirement not upgraded as not directly required: pyzmq in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (17.0.0)
Requirement not upgraded as not directly required: pygments>=2.0 in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (2.2.0)
Requirement not upgraded as not directly required: nbconvert in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (5.3.1)
Requirement not upgraded as not directly required: cloudpickle in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (0.5.3)
Requirement not upgraded as not directly required: jedi>=0.9.0 in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (0.12.0)
Requirement not upgraded as not directly required: rope>=0.10.5 in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (0.10.7)
Requirement not upgraded as not directly required: psutil in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (5.4.5)
Requirement not upgraded as not directly required: pyflakes in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (1.6.0)
Collecting pyqt5<5.10; python_version >= "3" (from spyder)
  Downloading https://files.pythonhosted.org/packages/5e/41/93bf8f289b476bc5d8cece7948a166cbcea761f5b1262e5fdd7076a5e02a/PyQt5-5.9.2-5.9.3-cp35.cp36.cp37-abi3-macosx_10_6_intel.whl (81.7MB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 81.7MB 178kB/s 
Requirement not upgraded as not directly required: qtpy>=1.2.0 in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (1.4.1)
Requirement not upgraded as not directly required: chardet>=2.0.0 in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (3.0.4)
Requirement not upgraded as not directly required: numpydoc in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (0.8.0)
Requirement not upgraded as not directly required: qtawesome>=0.4.1 in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (0.4.4)
Requirement not upgraded as not directly required: qtconsole>=4.2.0 in /opt/miniconda3/lib/python3.6/site-packages (from spyder) (4.3.1)
Requirement not upgraded as not directly required: six>=1.5 in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (1.11.0)
Requirement not upgraded as not directly required: Jinja2>=2.3 in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (2.10)
Requirement not upgraded as not directly required: docutils>=0.11 in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (0.14)
Requirement not upgraded as not directly required: snowballstemmer>=1.1 in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (1.2.1)
Requirement not upgraded as not directly required: babel!=2.0,>=1.3 in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (2.5.3)
Requirement not upgraded as not directly required: alabaster<0.8,>=0.7 in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (0.7.10)
Requirement not upgraded as not directly required: imagesize in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (1.0.0)
Requirement not upgraded as not directly required: requests>=2.0.0 in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (2.18.4)
Requirement not upgraded as not directly required: setuptools in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (39.1.0)
Requirement not upgraded as not directly required: packaging in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (17.1)
Requirement not upgraded as not directly required: sphinxcontrib-websupport in /opt/miniconda3/lib/python3.6/site-packages (from sphinx->spyder) (1.0.1)
Requirement not upgraded as not directly required: astroid<2.0,>=1.6 in /opt/miniconda3/lib/python3.6/site-packages (from pylint->spyder) (1.6.3)
Requirement not upgraded as not directly required: isort>=4.2.5 in /opt/miniconda3/lib/python3.6/site-packages (from pylint->spyder) (4.3.4)
Requirement not upgraded as not directly required: mccabe in /opt/miniconda3/lib/python3.6/site-packages (from pylint->spyder) (0.6.1)
Requirement not upgraded as not directly required: mistune>=0.7.4 in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (0.8.3)
Requirement not upgraded as not directly required: traitlets>=4.2 in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (4.3.2)
Requirement not upgraded as not directly required: jupyter_core in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (4.4.0)
Requirement not upgraded as not directly required: nbformat>=4.4 in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (4.4.0)
Requirement not upgraded as not directly required: entrypoints>=0.2.2 in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (0.2.3)
Requirement not upgraded as not directly required: bleach in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (2.1.3)
Requirement not upgraded as not directly required: pandocfilters>=1.4.1 in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (1.4.2)
Requirement not upgraded as not directly required: testpath in /opt/miniconda3/lib/python3.6/site-packages (from nbconvert->spyder) (0.3.1)
Requirement not upgraded as not directly required: parso>=0.2.0 in /opt/miniconda3/lib/python3.6/site-packages (from jedi>=0.9.0->spyder) (0.2.0)
Collecting sip<4.20,>=4.19.4 (from pyqt5<5.10; python_version >= "3"->spyder)
  Downloading https://files.pythonhosted.org/packages/b1/6f/782b6ff2770ebc6709dd7dc53a0636599a035853c78d785911fefc3f0e43/sip-4.19.8-cp36-cp36m-macosx_10_6_intel.whl (51kB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 61kB 13.5MB/s 
Requirement not upgraded as not directly required: MarkupSafe>=0.23 in /opt/miniconda3/lib/python3.6/site-packages (from Jinja2>=2.3->sphinx->spyder) (1.0)
Requirement not upgraded as not directly required: pytz>=0a in /opt/miniconda3/lib/python3.6/site-packages (from babel!=2.0,>=1.3->sphinx->spyder) (2018.4)
Requirement not upgraded as not directly required: idna<2.7,>=2.5 in /opt/miniconda3/lib/python3.6/site-packages (from requests>=2.0.0->sphinx->spyder) (2.6)
Requirement not upgraded as not directly required: urllib3<1.23,>=1.21.1 in /opt/miniconda3/lib/python3.6/site-packages (from requests>=2.0.0->sphinx->spyder) (1.22)
Requirement not upgraded as not directly required: certifi>=2017.4.17 in /opt/miniconda3/lib/python3.6/site-packages (from requests>=2.0.0->sphinx->spyder) (2018.4.16)
Requirement not upgraded as not directly required: pyparsing>=2.0.2 in /opt/miniconda3/lib/python3.6/site-packages (from packaging->sphinx->spyder) (2.2.0)
Requirement not upgraded as not directly required: lazy_object_proxy in /opt/miniconda3/lib/python3.6/site-packages (from astroid<2.0,>=1.6->pylint->spyder) (1.3.1)
Requirement not upgraded as not directly required: wrapt in /opt/miniconda3/lib/python3.6/site-packages (from astroid<2.0,>=1.6->pylint->spyder) (1.10.11)
Requirement not upgraded as not directly required: ipython_genutils in /opt/miniconda3/lib/python3.6/site-packages (from traitlets>=4.2->nbconvert->spyder) (0.2.0)
Requirement not upgraded as not directly required: decorator in /opt/miniconda3/lib/python3.6/site-packages (from traitlets>=4.2->nbconvert->spyder) (4.3.0)
Requirement not upgraded as not directly required: jsonschema!=2.5.0,>=2.4 in /opt/miniconda3/lib/python3.6/site-packages (from nbformat>=4.4->nbconvert->spyder) (2.6.0)
Requirement not upgraded as not directly required: html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre in /opt/miniconda3/lib/python3.6/site-packages (from bleach->nbconvert->spyder) (1.0.1)
Requirement not upgraded as not directly required: webencodings in /opt/miniconda3/lib/python3.6/site-packages (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->spyder) (0.5.1)
mkl-random 1.0.1 requires cython, which is not installed.
mkl-fft 1.0.0 requires cython, which is not installed.
Installing collected packages: sip, pyqt5, spyder
Successfully installed pyqt5-5.9.2 sip-4.19.8 spyder-3.2.8

Then

$ python -m spyder.app.start
Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.6/site-packages/qtpy/__init__.py", line 166, 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 "/opt/miniconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/miniconda3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/app/start.py", line 180, in <module>
    main()
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/app/start.py", line 158, in main
    from spyder.app import mainwindow
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 49, in <module>
    requirements.check_qt()
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/requirements.py", line 39, in check_qt
    import qtpy
  File "/opt/miniconda3/lib/python3.6/site-packages/qtpy/__init__.py", line 172, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found

if this helps, trying in a virtual environment I get this

$ virtualenv testspyder
....
$ pip install spyder
....
Requirement already satisfied: webencodings in /opt/miniconda3/lib/python3.6/site-packages (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->spyder) (0.5.1)
mkl-random 1.0.1 requires cython, which is not installed.
mkl-fft 1.0.0 requires cython, which is not installed.
Installing collected packages: spyder
Successfully installed spyder-3.2.8

$ pip install pyqt
Collecting pyqt
  Could not find a version that satisfies the requirement pyqt (from versions: )
No matching distribution found for pyqt

$ pip install pyqt5
Requirement already satisfied: pyqt5 in /opt/miniconda3/lib/python3.6/site-packages (5.9.2)
Requirement already satisfied: sip<4.20,>=4.19.4 in /opt/miniconda3/lib/python3.6/site-packages (from pyqt5) (4.19.8)
mkl-random 1.0.1 requires cython, which is not installed.
mkl-fft 1.0.0 requires cython, which is not installed.

$ python -m spyder.app.start
Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.6/site-packages/qtpy/__init__.py", line 166, 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 "/opt/miniconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/miniconda3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/app/start.py", line 180, in <module>
    main()
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/app/start.py", line 158, in main
    from spyder.app import mainwindow
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 49, in <module>
    requirements.check_qt()
  File "/opt/miniconda3/lib/python3.6/site-packages/spyder/requirements.py", line 39, in check_qt
    import qtpy
  File "/opt/miniconda3/lib/python3.6/site-packages/qtpy/__init__.py", line 172, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found

ah sorry I had not activated the virtualenv how silly of me will correct.

Well I now did correctly pip install spyder after having activated the fresh virtual env (apologies, again) and exact same result as reported above.

Besides, uninstalling spyder and doing pip install -U spyder gives same situation

As our Readme, install guide, troubleshooting guide, wiki, and documentation all make clear, under no circumstances should you ever install Spyder via pip (or anything, if it is available on conda) especially if you are already running under Anaconda. It likely will not work, and can break your install.

ah sorry I had not activated the virtualenv how silly of me will correct.

You are running under conda and using virtualenvs? Well no, that will just not work at all. That's what conda-env is for.

So, your whole install might be broken after those two things so it might not even work now, but the correct way to install Spyder in a fresh conda env, as stated in those above resources, is to create a new py3.6 env with conda (conda create -n <newenvnamehere> python=3.6 and then just run conda install spyder. If that doesn't work, you may need to uninstall anything you did before with pip and virtualenv, and reinstall Anaconda.

If you're still having trouble, 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.

Besides, uninstalling spyder and doing pip install -U spyder gives same situation

As our Readme, install guide, troubleshooting guide, wiki, and documentation all make clear, under no circumstances should you ever install Spyder via pip (or anything, if it is available on conda) especially if you are running under Anaconda. It likely will not work, and can break your install.

You have guessed I read none of the above... I was looking for a quick fix.

ah sorry I had not activated the virtualenv how silly of me will correct.

You are running under conda and using virtualenvs? Well no, that will just not work at all. That's what conda-env is for.

well sorry, but it is perfectly possible to set-up a python virtualenv with Python provided by conda. For a long time it did not work, but that was fixed some time ago.

https://github.com/conda/conda/issues/1367

So, your whole install might be broken after those two things so it might not even work now, but the correct way to install Spyder in a fresh conda env is to create a new py3.6 env with conda (conda create -n python=3.6and then just runconda install spyder. If that doesn't work, you may need to uninstall anything you did before withpipandvirtualenv``, and reinstall Anaconda.

There was no point for me to try a conda environment as it was already known to me that Spyder in a conda Python 3.6.5 env (on my Mac OS X 10.9.5) has the problems reported above.

It is quite possible that Anaconda has something bad in their Spyder package with conflicting requirements.

If you're still having trouble, 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 help. I will just wait until this get resolved eventually.

Thanks for the quick reply.

You have guessed I read none of the above... I was looking for a quick fix.

If you would like a quick fix, I would suggest reading any of the above (the current versions on this repo or the spyder-docs one), as they present a very short and simple sequence of steps that will immediately allow you to install spyder and fix the problem (assuming your install isn't broken).

well sorry, but it is perfectly possible to set-up a python virtualenv with Python provided by conda. For a long time it did not work, but that was fixed some time ago.

It may be, but I'm not sure I understand why there is ever any reason to鈥攚hy even install conda, then? Since as the issue you linked states, even with the fix you can't really reliably use conda when using virtualenvs, you should only use pip, and thus you lose out on the benefits of the conda ecosystem in the first place.

Which brings us to our second point鈥攁s those documents all also mention, we lack the resources to provide individual post install help for user install problems from installing via pip as that method is for experts only, and can result in many tricky user-specific install problems that are difficult for us to help you with from here. Therefore, in such situations, we are only able to recommend you use conda instead, as it is particularly easy for you to do since you already have it installed鈥攁ssuming your installation isn't borked, the above two commands should get you up and running posthaste, if you're looking for a "quick fix" :)

There was no point for me to try a conda environment as it was already known to me that Spyder in a conda Python 3.6.5 env (on my Mac OS X 10.9.5) has the problems reported above.

It is quite possible that Anaconda has something bad in their Spyder package with conflicting requirements.

Could clarify what makes you think this? That would be a very serious issue with Spyder/Anaconda if so. We only have received 3 reports of this error over the past 6 months since this one, and all of them were on Windows: one was someone downgrading their pip Qt install to a known unsupported version, one was clearly user install error (apparently in a similar fashion to this), and one had to do with a Windows and user-specific permissions issue with their Anaconda install.

Thanks for help. I will just wait until this get resolved eventually.

Sure, but not only should waiting not be necessary, but it is very unlikely to help, since your problem by all appearances (at least as you've described here) is not following the stated installed procedure, which none of us can fix from here.

Fwiw I have now, on another computer whose Anaconda install had seen none of my manoeuvers previously reported in my messages I did

$ conda create -n spyder python=3.6

and then

$ source activate spyder
$ conda install spyder

and the spyder on command line refuses to launch with the exact same error messages (edit: apart from line numbers) on command line as reported at top of this thread and then more recently by myself.

I am on Mac OS X 10.9.5.

Okay, thanks for clarifying. In that case, did you then try conda install pyqt? Some older versions of Spyder may not have had it installed automatically as a dependency since multiple versions were possible (I know that was true with pip, not 100% sure about conda). If the message is displayed as above, then that would probably be the possible anaconda bug discussed previously. In any case, you can try updating anaconda itself (conda update conda then conda update anaconda from the base environment, then create a fresh environment in the same way you did above, install spyder, and if it still doesn't work try pyqt5.6 instead (conda install pyqt=5.6) and see if it works under that.

Thanks for the quick help. I had updated my conda to 4.5.4. The install of spyder was accompanied as dependency by

    pyqt:                     5.9.2-py36h11d3b92_0  

I then did a second attempt with first conda installing pyqt then spyder. But still no luck.

Then in that environment I followed your advice to install pyqt5.6 and now success.

$ conda install pyqt=5.6
Solving environment: done

## Package Plan ##

  environment location: /opt/miniconda3/envs/spyder

  added / updated specs: 
    - pyqt=5.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    qt-5.6.2                   |      h9975529_14        65.3 MB
    pyqt-5.6.0                 |   py36he5c6137_6         4.2 MB
    sip-4.18.1                 |   py36h2824476_2         241 KB
    ------------------------------------------------------------
                                           Total:        69.7 MB

The following packages will be DOWNGRADED:

    pyqt: 5.9.2-py36h11d3b92_0  --> 5.6.0-py36he5c6137_6 
    qt:   5.9.5-h02808f3_0      --> 5.6.2-h9975529_14    
    sip:  4.19.8-py36h0a44026_0 --> 4.18.1-py36h2824476_2

Proceed ([y]/n)? 


Downloading and Extracting Packages
qt-5.6.2             | 65.3 MB | ####################################### | 100% 
pyqt-5.6.0           |  4.2 MB | ####################################### | 100% 
sip-4.18.1           |  241 KB | ####################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(spyder) 
~$ spyder &
[1] 12263

Thanks for helping me out.

I should add that I had been using spyder for perhaps three (four, actually) years (at various periods spaced by months of non-use) before these problems showed up: at some point a few weeks back I had wanted to use spyder again and I then hit these problems. This is why I recently wanted to give it a closer look and I tried to install it afresh.

Ah, excellent. Glad you got it working! I should have checked before (as I was thinking it might be, which is why I suggested it, but didn't think it would be dropped so soon), but the likely cause of your issue (unlike the OP) is that Qt 5.9 officially drops support for Mac OS 10.9. Obviously, nothing to do with Spyder, but something to be aware of. Thanks!

Ok, thanks for the info about Qt 5.9 dropping me alone abandoned in the wild ;-). Thanks again for you very quick help!

Yeah, they were pretty quick on the trigger on that one, I guess to match the much faster upgrade pace of the Mac ecosystem vs. the Windows one (Windows 7, released in 2009, is still supported up through the current 5.11 version and probably for quite a while, while 10.9 was released in 2013, and the earliest macOS version supported in 5.11 is 10.11, released 2015). Of course, we have zero control over any of that... In any case, glad you got it fixed, and sorry for any confusion/miscommunication back there.

@jfbu nasty problem points out (in my view) that we should perform a check of Qt > 5.9 and macOS < 10.11 to inform users that that combination is not allowed.

@CAM-Gerlach?

@ccordoba12 macOS < 10.10 for 5.9; its 5.11 that only supports 10.11 BTW

Sure, I guess鈥攊deally it should be handled at the conda or pyqt level by limiting 10.8 and 10.9 to PyQt 5.6 instead, but they ended up handling it by dropping support for pre-macOS 10.10 in Anaconda itself. Of course, we have no reason to be similarly restrictive, so if more users might run into this, best to include the check.

I think it's better to add these warning in qtpy instead of in Spyder itself. I'll open a new issue for that.

Just uninstall PyQt5
pip uninstall PyQt5
and install qtpy
pip install qtpy
works for me

Glad you were able to get everything working.

QtPy is a Spyder dependency, so it should have been installed automatically when installing Spyder. Of course, for anyone else viewing this thread, we don't recommend using pip (vs. conda) unless you're willing and able to solve its problems on your own, which @TheodoreKrypton evidently was.

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 for trying to help; however, this is known, closed issue who's actual cause (at least in the actual original issue report) is actually quite different from the one you state, and no further individuals have commented asking for assistance with it (or opened a new issue).

This error means that you installed pyqt5 with pip along side the pyqt conda package.

This could be one cause of that error, but apparently was not in this case based on the original issue report, and there are a number of potential others (including this one) which your suggestion does not address. Therefore, it 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.

@CAM-Gerlach Thank you very much, it worked for me!
To sum up, this is what I did to resolve the problem:

pip uninstall PyQt5
conda update conda
conda update anaconda-navigator
conda install --force-reinstall pyqt qt

I had this issue on a clean Anaconda install on Windows 7 as well. The cause of this issue (at least for me) was that my PATH variable contained another path with different Qt5 dll's before the anaconda path (Anaconda adds it to the user PATH, the other was in the system PATH, which takes precedence).

Solution: Either reorder your PATH (for example add anaconda to the start of the system PATH) or remove the other offending path(s). There is NO need to uninstall software as suggested in issue #8223...

So the issue is with PyQt5 not using its own dll's, I can image this could affect other platforms as well.

There is NO need to uninstall software as suggested in issue #8223

Actually there was, if another software doesn't modify PATH but install its own set of Qt5 libraries on C:\System\Win32 (or something similar). But that was fixed in one of the latest Anaconda releases.

I recked my conda environment after updating with --all for conda.

I tried with installing a fresh anaconda and update the conda and conda-build.

Created a new virtual env with python=3.6 and tried installing spyder in the environment after activating it.

I am getting below error:
Executing transaction: | DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'D:\vikram\anaconda\envs\udatoz3.6', env_name: 'udatoz3.6', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(323): Shortcut cmd is D:\vikram\anaconda\pythonw.exe, args are ['D:\vikram\anaconda\cwp.py', 'D:\vikram\anaconda\envs\udatoz3.6', 'D:\vikram\anaconda\envs\udatoz3.6\pythonw.exe', 'D:\vikram\anaconda\envs\udatoz3.6\Scripts\spyder-script.py']
/ DEBUG menuinst_win32:create(323): Shortcut cmd is D:\vikram\anaconda\python.exe, args are ['D:\vikram\anaconda\cwp.py', 'D:\vikram\anaconda\envs\udatoz3.6', 'D:\vikram\anaconda\envs\udatoz3.6\python.exe', 'D:\vikram\anaconda\envs\udatoz3.6\Scripts\spyder-script.py', '--reset']

  • ERROR conda.core.link:_execute_post_link_actions(720): An error occurred while installing package 'defaults::qt-5.9.7-vc14h73c81de_0'.
    LinkError: post-link script failed for package defaults::qt-5.9.7-vc14h73c81de_0

    running your command again with -v will provide additional information
    location of failed script: D:\vikram\anaconda\envs\udatoz3.6\Scripts.qt-post-link.bat
    ==> script messages <==

Attempting to roll back.

I am unable to run the spyder as i need to run it in a particular environment.

I found two solutions on stackoverflow:

  1. Run spyder in virtualenv
  2. Spyder in windows 10 anaconda virtual env

I coudnt find any solution so posting in this thread.
I have installed anaconda in D:\vikram\anaconda

OS: Windows 10
Anaconda: Anaconda3-2019.03-Windows-x86_64

(base) C:\Users\username>conda info

     active environment : base
    active env location : D:\vikram\anaconda
            shell level : 1
       user config file : C:\Users\username\.condarc
 populated config files : C:\Users\username\.condarc
          conda version : 4.7.5
    conda-build version : 3.18.5
         python version : 3.7.3.final.0
       virtual packages :
       base environment : D:\vikram\anaconda  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : D:\vikram\anaconda\pkgs
                          C:\Users\username\.conda\pkgs
                          C:\Users\username\AppData\Local\conda\conda\pkgs
       envs directories : D:\vikram\anaconda\envs
                          C:\Users\username\.conda\envs
                          C:\Users\username\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.5 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.14393
          administrator : False
             netrc file : None
           offline mode : False

Edit: After updating conda and conda-build and running conda install -f python.app , i was able to use conda environment.

guys just right click on the spyder icon in the toolbar and press on maximise and it should open

Was this page helpful?
0 / 5 - 0 ratings