0
votes

From the Anaconda command prompt I launch Spyder. Spyder launches, even loading and issuing a warning that my previous session crashed and that I should consider resetting (which I eventually did without result). The process carries on and then hangs on forever, failing to start (i.e. open the working windows with code, console, variables etc.)

Tried to reset Spyder

Spyder --reset

Spyder resets properly but still fails to start

Spyder Version: 3.1.4 Python Version: 2.7.13 Anaconda Version: 4.3.21 Qt Version: 5.6.2 PyQt Version: 5.6.0 Operating system: Windows 10

Then I uninstalled and reinstalled Anaconda this time Version: 2.4.4.0. Spyder launched once satisfactorily only to crash ever after.

Investigating the process further, it cought up the following error:

spyder --show-console

(C:\Users\me\Anaconda2) C:\Users\me>spyder --show-console Traceback (most recent call last): File "C:\Users\me\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 3011, in main mainwindow = run_spyder(app, options, args) File "C:\Users\me\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 2913, in run_spyder main.setup() File "C:\Users\me\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 873, in setup from spyder.plugins.ipythonconsole import IPythonConsole File "C:\Users\me\Anaconda2\lib\site-packages\spyder\plugins\ipythonconsole.py", line 60, in from spyder.widgets.ipythonconsole import ClientWidget File "C:\Users\me\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole_init_.py", line 12, in from .debugging import DebuggingWidget File "C:\Users\me\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\debugging.py", line 16, in from qtconsole.rich_jupyter_widget import RichJupyterWidget File "C:\Users\me\Anaconda2\lib\site-packages\qtconsole\rich_jupyter_widget.py", line 14, in from .jupyter_widget import JupyterWidget File "C:\Users\me\Anaconda2\lib\site-packages\qtconsole\jupyter_widget.py", line 19, in from IPython.lib.lexers import IPythonLexer, IPython3Lexer File "C:\Users\me\Anaconda2\lib\site-packages\IPython_init_.py", line 48, in from .core.application import Application File "C:\Users\me\Anaconda2\lib\site-packages\IPython\core\application.py", line 25, in from IPython.core import release, crashhandler File "C:\Users\me\Anaconda2\lib\site-packages\IPython\core\crashhandler.py", line 28, in from IPython.core import ultratb File "C:\Users\me\Anaconda2\lib\site-packages\IPython\core\ultratb.py", line 128, in from IPython.utils.terminal import get_terminal_size File "C:\Users\me\Anaconda2\lib\site-packages\IPython\utils\terminal.py", line 22, in from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size ImportError: No module named shutil_get_terminal_size

(C:\Users\me\Anaconda2) C:\Users\me>

So then I tried the following:

(C:\Users\me\Anaconda2) C:\Users\me>conda install shutil_get_terminal_size Fetching package metadata ...........

PackageNotFoundError: Package missing in current win-64 channels:

shutil_get_terminal_size Close matches found; did you mean one of these?

shutil_get_terminal_size: get_terminal_size

Btw Spyder issue or Anaconda issue?

So anway I proceeded to install get_terminal_size and have a go at it

(C:\Users\me\Anaconda2) C:\Users\me>conda install get_terminal_size Fetching package metadata ........... Solving package specifications: .

All requested packages already installed. packages in environment at C:\Users\me\Anaconda2:

get_terminal_size 1.0.0 py27_0

Then tries again to launch in the command prompt

spyder

which fails including trying once again after resetting

spyder --reset

Investigating further

spyder --show-console

results in me returning straight back to square one

(C:\Users\me\Anaconda2) C:\Users\me>spyder --show console Traceback (most recent call last): File "C:\Users\me\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 3011, in main mainwindow = run_spyder(app, options, args) File "C:\Users\me\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 2913, in run_spyder main.setup() File "C:\Users\me\Anaconda2\lib\site-packages\spyder\app\mainwindow.py", line 873, in setup from spyder.plugins.ipythonconsole import IPythonConsole File "C:\Users\me\Anaconda2\lib\site-packages\spyder\plugins\ipythonconsole.py", line 60, in from spyder.widgets.ipythonconsole import ClientWidget File "C:\Users\me\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole_init_.py", line 12, in from .debugging import DebuggingWidget File "C:\Users\me\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\debugging.py", line 16, in from qtconsole.rich_jupyter_widget import RichJupyterWidget File "C:\Users\me\Anaconda2\lib\site-packages\qtconsole\rich_jupyter_widget.py", line 14, in from .jupyter_widget import JupyterWidget File "C:\Users\me\Anaconda2\lib\site-packages\qtconsole\jupyter_widget.py", line 19, in from IPython.lib.lexers import IPythonLexer, IPython3Lexer File "C:\Users\me\Anaconda2\lib\site-packages\IPython_init_.py", line 48, in from .core.application import Application File "C:\Users\me\Anaconda2\lib\site-packages\IPython\core\application.py", line 25, in from IPython.core import release, crashhandler File "C:\Users\me\Anaconda2\lib\site-packages\IPython\core\crashhandler.py", line 28, in from IPython.core import ultratb File "C:\Users\me\Anaconda2\lib\site-packages\IPython\core\ultratb.py", line 128, in from IPython.utils.terminal import get_terminal_size File "C:\Users\me\Anaconda2\lib\site-packages\IPython\utils\terminal.py", line 22, in from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size ImportError: No module named shutil_get_terminal_size

PS: I have used with satisfaction Anaconda and Spyder for months now without any issue, cannot understand what's wrong.

1

1 Answers

0
votes

Actually I found a solution which was to conda reinstall ipython and pip reinstall backports.shutil_get_terminal_size :

conda uninstall ipython
conda install python
pip uninstall backports.shutil_get_terminal_size
pip install backports.shutil_get_terminal_size

For more info I suggest to consult the following issues:

For some reason however Spyder then issues a warning that nbconvert isn't installed whereas both conda and pip install nbconvert show that nbconvert is fully installed and up to date...

Spyder dependancy missing nbconvert >=4.0: None (NOK) Please install to prevent this message displaying Fetching package metadata ........... Solving package specifications: .

conda install nbconvert

All requested packages already installed. packages in environment at C:\Users\me\Anaconda2:

nbconvert 5.2.1 py27_0

pip install nbconvert

Requirement already satisfied: nbconvert in c:\users\me\anaconda2\lib\site-packages Requirement already satisfied: mistune!=0.6 in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: jinja2 in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: pygments in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: traitlets>=4.2 in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: jupyter_core in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: nbformat in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: entrypoints>=0.2.2 in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: bleach in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: pandocfilters>=1.4.1 in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: testpath in c:\users\me\anaconda2\lib\site-packages (from nbconvert)

Requirement already satisfied: MarkupSafe>=0.23 in c:\users\me\anaconda2\lib\site-packages (from jinja2->nbconvert)

Requirement already satisfied: six in c:\users\me\anaconda2\lib\site-packages (from bleach->nbconvert)

Requirement already satisfied: html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 in c:\users\me\anaconda2\lib\site-packages (from bleach->nbconvert)