我在 Windows 10 上使用通过 Anaconda 安装的 pandas
。
我在 emacs 下级 Python shell 中运行 IPython 终端。
每次我在终端上打印 pandas.DataFrame
时,都会收到一条错误消息 tput: Unknownterminal "emacs"
。
错误消息后面跟着正确的输出,所以我希望我可以关闭错误消息。
看起来类似于this question 。无论如何,我的 PATH 环境变量中确实有 Git/bin,但我不知道这会如何影响任何事情。
如有任何建议,我们将不胜感激。
最佳答案
我在 Windows 7 下的 Eclipse (Mars 2) 调试视角中操作 pandas.DataFrame
时遇到了类似的问题。
当尝试检查 DataFrame
的内容时,控制台将输出:
tput: unknown terminal "emacs"
而该值将显示(pending)
,并且调试 session 将永远卡住。
我发现 tput
命令确实是 cygwing 附带的 unix 命令:
D:\smouton>where tput
d:\smouton\cygwin64\bin\tput.exe
我设置的解决方法是在启动 Eclipse 之前修改 PATH
变量。通过启动以下批处理文件而不是 Eclipse 可执行文件可以方便地完成此操作:
REM Remove reference to "unixy" stuff before calling eclipse
REM This avoids 'tput: unknown terminal "emacs"' error when manipulating pandas dataframe
SET PATH=%PATH:;C:\MinGW\bin;d:\smouton\cygwin64\bin;=;%
REM launch eclipse
START "" "C:\Program Files (x86)\Eclipse\eclipse.exe"
此文件只是从 PATH 中删除 C:\MinGW\bin
和 d:\smouton\cygwin64\bin
,然后启动 eclipse。
我认为类似的解决方法也可以解决 OP 使用 IPython 的问题。
关于python - pandas 打印 `tput: unknown terminal "emacs"`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36133447/