Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tput: terminal attributes: No such device or address in Windows Pycharm debugger

I am getting a red message every time I use the console from the debugger and try to see the output of a pandas object

"tput: terminal attributes: No such device or address"

I am using PyCharm 2016.3.2 and according to me I didn't update anything - it just started to appear all of a sudden. I attach a screenshot of the debugger with info on my ipython and debugger versions. Would appreciate your help to understand how to get rid of this message. It seems to appear both in the Python Console and Debugger Console, but not in the PyCharm Terminal. Thanks.

enter image description here

like image 455
tsando Avatar asked Mar 16 '17 14:03

tsando


3 Answers

There is a workaround inside PyCharm itself without affecting the rest of the system:

You can hard code PATH as part of Environment set up under this menu:

  1. Click menu Run -> Edit/Configurations...
  2. when the configuration window opens, click on Defaults -> Python.
  3. On the right side under Environment Variables hard code PATH without git/cygwin. See below how to get that path from cmd prompt

    import os, re; print ';'.join([p for p in os.getenv('PATH').split(';') if not re.search('Git', p)])

  4. This PATH variable seems to overwrite system's path variable.


    Image of these steps overlaid in PyCharm.

PyCharm Default Debug Configuration


like image 167
jedi Avatar answered Nov 17 '22 17:11

jedi


Another workaround is to simply move tput to a different cygwin PATH directory,

e.g. if tput is in ~/git-for-windows/usr/bin, and the same directory is in the windows PATH, moving tput.exe to ~/git-for-windows/usr/local/bin will fix the issue in pycharm and still work within cygwin

like image 3
Jether Avatar answered Nov 17 '22 16:11

Jether


Have you installed git or cygwin recently? If so, try to delete git or cygwin related paths from system environment variable PATH. If had the same problem as you and now have fixed it by doing so.

like image 2
Hongjian Avatar answered Nov 17 '22 16:11

Hongjian