我是巨蟒的初学者。我面临以下问题。
每当我启动pycharm社区版(5.0.3版)时,python控制台都无法启动,并显示以下错误:
usr/bin/python2.7 /usr/lib/pycharm-community/helpers/pydev/pydevconsole.py 53192 49994
Traceback (most recent call last):
File "/usr/lib/pycharm-community/helpers/pydev/pydevconsole.py", line 488, in <module>
pydevconsole.StartServer(pydev_localhost.get_localhost(), int(port), int(client_port))
File "/usr/lib/pycharm-community/helpers/pydev/pydevconsole.py", line 330, in StartServer
interpreter = InterpreterInterface(host, client_port, threading.currentThread())
File "/usr/lib/pycharm-community/helpers/pydev/pydev_ipython_console.py", line 26, in __init__
self.interpreter = get_pydev_frontend(host, client_port)
File "/usr/lib/pycharm-community/helpers/pydev/pydev_ipython_console_011.py", line 472, in get_pydev_frontend
_PyDevFrontEndContainer._instance = _PyDevFrontEnd()
File "/usr/lib/pycharm-community/helpers/pydev/pydev_ipython_console_011.py", line 303, in __init__
self.ipython = PyDevTerminalInteractiveShell.instance()
File "/usr/lib/python2.7/dist-packages/IPython/config/configurable.py", line 354, in instance
inst = cls(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py", line 328, in __init__
**kwargs
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 483, in __init__
self.init_readline()
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 1816, in init_readline
if self.readline_use:
File "/home/vivekruhela/.local/lib/python2.7/site-packages/traitlets/traitlets.py", line 529, in __get__
return self.get(obj, cls)
File "/home/vivekruhela/.local/lib/python2.7/site-packages/traitlets/traitlets.py", line 507, in get
% (self.name, obj))
traitlets.traitlets.TraitError: No default value found for None trait of <pydev_ipython_console_011.PyDevTerminalInteractiveShell object at 0x7f7b0e682cd0>
Process finished with exit code 1
Couldn't connect to console process.
如何连接到Pycharm控制台?我已经在系统中安装了IPython。
最佳答案
我发现发生这种情况是因为我安装了IPython 4.x版,然后恢复到3.2.0版,而没有先卸载Traitlets更高级的版本。这就成功了:
pip uninstall ipython[all]
pip uninstall traitlets
pip install ipython==3.2.0
关于python - Pycharm中的traitlets.traitlets.TraitError,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35176604/