我在Windows 10上运行Python2.7,使用Anaconda进行环境和大多数pkg管理。升级了许多软件包后,我的ipython控制台现在无法在任何IDE或控制台中启动。当我尝试在控制台上运行它时,出现此错误:
Traceback (most recent call last): File "C:\Anaconda3\Scripts\ipython-script.py", line 3, in <module> import IPython File "C:\Anaconda3\lib\site-packages\IPython\__init__.py", line 48, in <module> from .core.application import Application File "C:\Anaconda3\lib\site-packages\IPython\core\application.py", line 24, in <module> from IPython.core import release, crashhandler File "C:\Anaconda3\lib\site-packages\IPython\core\crashhandler.py", line 28, in <module> from IPython.core import ultratb File "C:\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 121, in <module> from IPython.utils.terminal import get_terminal_size File "C:\Anaconda3\lib\site-packages\IPython\utils\terminal.py", line 27, in <module> import backports.shutil_get_terminal_size ImportError: No module named backports.shutil_get_terminal_size
我尝试做的第一件事是:
pip install --upgrade backports.shutil_get_terminal_size
输出:
Requirement already up-to-date: backports.shutil_get_terminal_size in c:\anaconda3\lib\site-packages
我已经卸载并重新安装了ipython
conda uninstall ipython conda install ipython
和
pip uninstall ipython pip install ipython
仍然行不通。请帮忙!
尝试这个
conda config --add channels conda-forge conda install backports.shutil_get_terminal_size