拜托,你能帮忙吗?我无法在PyCharm中启动python控制台。尝试了所有可用选项并浏览了文档,但无法弄清楚这一点。任何帮助,将不胜感激。请在下面找到我在控制台中看到的错误...

操作系统:Win 10

C:\Miniconda3\python.exe "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\pydevconsole.py" 64331 64332
Traceback (most recent call last):
  File "C:\Miniconda3\lib\site-packages\traitlets\traitlets.py", line 526, in get
    value = obj._trait_values[self.name]
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\pydevconsole.py", line 526, in <module>
    pydevconsole.start_server(pydev_localhost.get_localhost(), int(port), int(client_port))
  File "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\pydevconsole.py", line 355, in start_server
    interpreter = InterpreterInterface(host, client_port, threading.currentThread())
  File "C:\Program Files (x86)\JetBrains\PyCharm\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\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\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 318, in __init__
    self.ipython = PyDevTerminalInteractiveShell.instance()
  File "C:\Miniconda3\lib\site-packages\IPython\config\configurable.py", line 337, in instance
    inst = cls(*args, **kwargs)
  File "C:\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 512, in __init__
    self.init_readline()
  File "C:\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 1911, in init_readline
    if self.readline_use:
  File "C:\Miniconda3\lib\site-packages\traitlets\traitlets.py", line 554, in __get__
    return self.get(obj, cls)
  File "C:\Miniconda3\lib\site-packages\traitlets\traitlets.py", line 532, in get
    % (self.name, obj))
traitlets.traitlets.TraitError: No default value found for None trait of <_pydev_bundle.pydev_ipython_console_011.PyDevTerminalInteractiveShell object at 0x00000000042CFBA8>
Process finished with exit code 1

最佳答案

好吧,经过很多讨论之后:
将解释器更改为其他版本(至Python 3.5.x)可以完成此工作。这让我想知道IPython是否是问题所在。

问题在于,适用于Python 3.3.5的IPython不适用于PyCharm。 IPython版本5由PyCharm安装,但不适用于Python 3.3.5。

我先使用“ Conda卸载”删除了IPython,然后使用“ Conda clean”删除了IPython,然后重新启动了控制台,然后它像一个魅力一样工作了。

在本质上:
1.退出皮查姆
2.删除IPython-使用“ Conda删除/卸载”,然后使用“ conda clean”完全删除它。
3.重新启动Pycharm,并允许其重新导入所有“骨骼”
4.重新启动控制台。

关于python - Python 3.3.5控制台无法在PyCharm 2016.3.1中启动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41361677/

10-11 22:23
查看更多