Dies funktioniert, aber jetzt nicht, in IPython 4.2.0 und Spyder 2.3.9 von Anaconda. Argh.Warum gehorcht Spyder nicht meiner IPython-Konfigurationsdatei?
Wenn ich die IPython bekommen Config es korrekt aussieht, als ob er die Datei richtig gelesen:
get_ipython().config
Out[1]:
{'IPCompleter': {'greedy': True},
'IPKernelApp': {'exec_lines': ['%pylab qt']},
'InlineBackendConfig': {},
'InteractiveShell': {'xmode': 'Plain'},
'InteractiveShellApp': {'exec_lines': ['from __future__ import division',
'from __future__ import print_function',
'from __future__ import with_statement',
'from numpy import set_printoptions',
'set_printoptions(suppress=True, precision=4)',
'from sympy import init_printing',
'init_printing(forecolor="White")'],
'pylab': 'auto'},
'StoreMagics': {'autorestore': True},
'ZMQInteractiveShell': {'autocall': 0, 'banner1': ''}}
So ist es soll zukünftige Teilung und numpy Unterdrückung haben, aber es funktioniert tatsächlich nicht:
division
Out[1]: _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)
4/5
Out[2]: 0
np.get_printoptions()
Out[3]:
{'edgeitems': 3,
'formatter': None,
'infstr': 'inf',
'linewidth': 75,
'nanstr': 'nan',
'precision': 8,
'suppress': False,
'threshold': 1000}
eps = np.finfo(float).eps; x = np.arange(4.); x**2 - (x + eps)**2
Out[4]:
array([ -4.93038066e-32, -4.44089210e-16, 0.00000000e+00,
0.00000000e+00])
Dies ist, was es tun sollte:
from __future__ import division
division
Out[2]: _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)
4/5
Out[3]: 0.8
np.set_printoptions(suppress=True)
eps = np.finfo(float).eps; x = np.arange(4.); x**2 - (x + eps)**2
Out[5]: array([-0., -0., 0., 0.])
np.get_printoptions()
Out[6]:
{'edgeitems': 3,
'formatter': None,
'infstr': 'inf',
'linewidth': 75,
'nanstr': 'nan',
'precision': 8,
'suppress': True,
'threshold': 1000}
Regular IPython arbeitet correctl y (C:\Anaconda2\python.exe C:\Anaconda2\cwp.py C:\Anaconda2 "C:/Anaconda2/python.exe" "C:/Anaconda2/Scripts/ipython-script.py"
)
Jupyter QTConsole richtig funktioniert (C:\Anaconda2\pythonw.exe C:\Anaconda2\cwp.py C:\Anaconda2 "C:/Anaconda2/pythonw.exe" "C:/Anaconda2/Scripts/jupyter-qtconsole-script.py"
)
Ist es mit [diesem Fehler] (https://github.com/spyder-ide/spyder/issues/3354) in Spyder verbunden? –
@PeterBrittain Nein, aber das ist ein guter Workaround! – endolith
Die eine wahrscheinlich nervige Antwort (niemand will neu installieren) kann auf etwas sein. Anaconda 4.2 war voller Fehler. Ich habe mich an GITHUB-Posting-Problemen beteiligt und sie waren sehr gut darin, sich mit ihnen zu beschäftigen, obwohl sie wahrscheinlich gegen geplante Veröffentlichungen und die Probleme anderer Leute, die ich sicher bin, Prioritäten setzen mussten. Anaconda 4.3.1 ist jetzt out. Vielleicht möchten Sie ein Upgrade versuchen und sehen, ob Ihr Problem behoben wird. Sie können auch auf den Link zum Spyder-Fehler klicken und dem Projekt folgen, um Ihr Problem zur Hilfe zu stellen. – TMWP