Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

traitlets.traitlets.TraitError in Pycharm

I am a beginner in python. I am facing the following problem.

Whenever I start pycharm Community edition (version 5.0.3), the Python console fails to starts and shows the following error:

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.

How can I connect to the pycharm console? I have already installed IPython in my system.

like image 339
Lot_to_learn Avatar asked Feb 03 '16 12:02

Lot_to_learn


4 Answers

I've found that this happened because I had installed ipython version 4.x, and then reverted to 3.2.0, without uninstalling the traitlets more advanced version first. This did the trick then:

pip uninstall ipython[all]
pip uninstall traitlets
pip install ipython==3.2.0
like image 43
mirandes Avatar answered Oct 21 '22 06:10

mirandes


I had the same issue. I solved this by updating ipython.

My version was 3.1.0, upgrading it to 4.1.1 solved it.

in my case:

workon project
pip install -U ipython
like image 56
Dionys Avatar answered Oct 21 '22 06:10

Dionys


In my case, this was due to a conflicting installation of IPython through pip and apt. Removing the apt-installed version using sudo apt remove ipython fixed the problem.

like image 40
Jake Avatar answered Oct 21 '22 06:10

Jake


I initially tried unsuccessfully by trying

pip install -U ipython

But then tried following and it worked:

pip uninstall ipython[all]
pip uninstall traitlets
pip install ipython

Thanks @mirandes

like image 40
Dibyendu Dey Avatar answered Oct 21 '22 04:10

Dibyendu Dey