tput: terminal attributes: No such device or addre

2019-05-05 17:04发布

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

6条回答
爷的心禁止访问
2楼-- · 2019-05-05 17:32

additional for Anaconda2 Users, you will find tput.exe in following two path:

Anaconda2\Library\usr\bin Anaconda2\pkgs\git-xxx\Library\usr\bin

mv them to xxx\usr\local\bin

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-05-05 17:39

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


查看更多
闹够了就滚
4楼-- · 2019-05-05 17:40

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

查看更多
迷人小祖宗
5楼-- · 2019-05-05 17:41

My colleague had the same error. It occurred only for pandas.

We resolved it by changing the project interpreter in PyCharm to the anaconda one, where he previously set up everything else. If for example, you use Anaconda navigator, then all the tput paths are set up there. (Maybe the settings got lost when downloading a new PyCharm version.)

I'm sharing this to give people some more ideas where to look for, not to get too focussed on cygwin.

查看更多
【Aperson】
6楼-- · 2019-05-05 17:44

Just to complement the answer from H.J. Liu, if you are unable to delete cygwin from the system PATH, then it is probably in the user PATH. Please see this related post Unable to remove cygwin from PATH environment variable

查看更多
7楼-- · 2019-05-05 17:50

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.

查看更多
登录 后发表回答