Cannot run Spyder because No module named 'PySide'

Question:

I wanted to try using Spyder IDE. I was reading this page on how to open and run Spyder: https://github.com/spyder-ide/spyder/releases

I typed the following commands as specified in the page:

conda update qt pyqt
conda update spyder

Both commands gave “# All requested packages already installed.”.

I then typed spyder into my terminal (Mac):

Macs-MacBook:~ macuser$ spyder
Traceback (most recent call last):
  File "/anaconda3/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 "/anaconda3/bin/spyder", line 11, in <module>
    sys.exit(main())
  File "/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 159, in main
    from spyder.app import mainwindow
  File "/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 49, in <module>

So, I tried to install PySide:

Macs-MacBook:~ macuser$ conda install PySide
Solving environment: failed

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

What should I do to get up and running with Spyder?

Asked By: Doug Fir

||

Answers:

try below commands let me know if it works.

 pip install msgpack
 conda install qt=5.6 pyqt=5.6 sip=4.18
Answered By: jits_on_moon

Mr J.

I had the same problem as Doug Fir. I used these commands. I launched spyder from the DOS prompt. I got “RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa” as was the case before. Just as I was rolling my eyes, Spyder went ahead and started. So I think it worked.

Answered By: A Gokce

While other solutions found on the web didn’t work for me (such as the one above and using $ pip install pyqt5), I solved this by uninstalling and reinstalling Spyder via terminal, using pip.


$ pip uninstall spyder
...

$ pip install spyder
...

Not sure why, but it worked on the first try.

Answered By: Or Ido

Try to delete the .condarc file. I do not know the specific reason but I faced the same issue and when I deleted the .condarc file it worked for me.

Answered By: Praffulla

I had same error on Linux and solved deleting:

rm -rf .local/lib/python3.9/
rm -rf .local/share/Spyder/
Answered By: G. C.
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.