我的环境:
- Win 10
- Anaconda 4.7.11(Prompt 中运行
conda -V
可查看) - Python 3.7.1
- Pycharm 2017.1
问题
在控制台运行代码:选中代码 → Shift+Alt+E
(或者右键
→Execute Selection in Concole
)
出现控制台无法连接(Couldn't connect to console process.
,ValueError: list.remove(x): x not in list
)的报错:
C:\Users\admin\Anaconda3\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2017.1\helpers\pydev\pydevconsole.py" 51563 51564
C:\Users\admin\Anaconda3\lib\site-packages\IPython\core\history.py:226: UserWarning: IPython History requires SQLite, your history will not be saved
warn("IPython History requires SQLite, your history will not be saved")
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 2017.1\helpers\pydev\pydevconsole.py", line 530, in <module>
pydevconsole.start_server(pydev_localhost.get_localhost(), int(port), int(client_port))
File "C:\Program Files (x86)\JetBrains\PyCharm 2017.1\helpers\pydev\pydevconsole.py", line 359, in start_server
interpreter = InterpreterInterface(host, client_port, threading.currentThread())
File "C:\Program Files (x86)\JetBrains\PyCharm 2017.1\helpers\pydev\_pydev_bundle\pydev_ipython_console.py", line 25, in __init__
self.interpreter = get_pydev_frontend(host, client_port, show_banner=show_banner)
File "C:\Program Files (x86)\JetBrains\PyCharm 2017.1\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 488, in get_pydev_frontend
_PyDevFrontEndContainer._instance = _PyDevFrontEnd(show_banner=show_banner)
File "C:\Program Files (x86)\JetBrains\PyCharm 2017.1\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 318, in __init__
self.ipython = PyDevTerminalInteractiveShell.instance()
File "C:\Users\admin\Anaconda3\lib\site-packages\traitlets\config\configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "C:\Users\admin\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 455, in __init__
super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
File "C:\Users\admin\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 668, in __init__
self.init_completer()
File "C:\Program Files (x86)\JetBrains\PyCharm 2017.1\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 243, in init_completer
self.Completer =
...
ValueError: list.remove(x): x not in list
Process finished with exit code 1
Couldn't connect to console process.
解决方法
产生的原因可能是因为:系统的 python环境和 ipython 冲突
在Prompt 中:
- 查看 ipython的版本,我当前为最新版本 7.9.0
pip show ipython
- 卸载当前版本:
pip uninstall ipython
- 安装 6.2.0 版本
pip install ipython==6.2.0
- 最后记得重启 Pycharm !
控制台恢复正常!
参考以下,感谢!
CSDN博文: pycharm ipython控制台无法连接:ValueError: list.remove(x): x not in list
Stackoverflow:Pycharm console cannot connect after update
其它:解决PyCharm提示Couldn’t connect to console process
最后Mark一个工具:YouTrack
官方网站:https://youtrack.jetbrains.com/issues
介绍:YouTrack(一)简介以及搭建
我目前的理解:类似于GitLab的项目管理平台?