Skip to content
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

Matplotlib fails on new install (of Spyder with Anaconda3) #4338

Closed
groundhogxc opened this issue Apr 7, 2017 · 6 comments
Closed

Matplotlib fails on new install (of Spyder with Anaconda3) #4338

groundhogxc opened this issue Apr 7, 2017 · 6 comments
Assignees

Comments

@groundhogxc
Copy link

Description

On a new install as part of Anaconda3, Spyder fails to execute the demo program due to failure of importing matplotlib.

Not sure if this is an Anaconda or Spyder problem to be honest, but the packages seem to be there. Maybe a wrong matplotlib backend is used by default?

What steps will reproduce the problem?

  1. Install Spyder in Windows (here Win 10 1607)
  2. Start Spyder
  3. Klick into tmp.py and hit "F5"

What is the expected output? What do you see instead?

Spyder should ouptut a figure in some way.

Instead, it fails with

[...]
File "...\Anaconda3\lib\site-packages\matplotlib\backends\qt_compat.py", line 137, in
from PyQt4 import QtCore, QtGui

Please provide any additional information below

Spyder install was part of Anaconda3 (Version 4.3.1). qt5 5.6 and pyqt5 are present.

Version and main components

  • Spyder Version: 3.1.2
  • Python Version: 3.6.0
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

jedi >=0.8.1     :  0.9.0 (OK)
matplotlib >=1.0 :  2.0.0 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.3 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
pylint >=0.25    :  1.6.4 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.5.1 (OK)
sympy >=0.7.3    :  1.0 (OK)

@ccordoba12
Copy link
Member

How are you running tmp.py, in the Python or IPython console?

@groundhogxc
Copy link
Author

groundhogxc commented Apr 7, 2017

Just pressing F5 after start seems to try to run it in IPython.

Now I checked the same after switching to the Python console first; here it actually works! (of course then the figure opens in separate window in background)

And it is "temp.py" of course, not "tmp.py". Sorry.

@ccordoba12
Copy link
Member

Please post the contents of tmp.py so we can try to reproduce this in our end.

@groundhogxc
Copy link
Author

Oh, for some reason I thought this was an example file provided by Spyder or Anaconda3. Sorry if this is not the case. It was supposed to be a fresh install of Anaconda3, though.
Here is the script, just a simple plot:

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

import matplotlib.pyplot as plt
import numpy as np
x=np.linspace(0,10,100)
plt.plot(x,np.cos(x)+x)
plt.show()

@groundhogxc
Copy link
Author

groundhogxc commented Apr 11, 2017

Ok, so your last comment made me check more closely the machine history. It is possible hat there was a prior version of Anaconda not perfectly removed (although it should have been). So it could be that it is (something like) this (old) issue really:

ContinuumIO/anaconda-issues#1068

Maybe just close this for now. I'll check on a fresh install at some point and if it happens again, I'll reopen.
Sorry for the possible false issue.

@ccordoba12
Copy link
Member

Ok, let us know how this ends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants