python - pandas 打印 `tput: unknown terminal "emacs"`

标签 python shell pandas emacs ipython

我在 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\bind:\smouton\cygwin64\bin,然后启动 eclipse。

我认为类似的解决方法也可以解决 OP 使用 IPython 的问题。

关于python - pandas 打印 `tput: unknown terminal "emacs"`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36133447/

相关文章:

bash - lsof 应该为一组 pids 提供所有打开的文件

bash - 如何在 Bash 脚本中执行 Zsh shell 命令

python - 将数据帧拆分为多个 5 秒数据帧并在 Python 中获取计数

python - Pandas 将日期值存储在错误的列中

python - 如何使用 Jupyter 笔记本解决 Python 中形状为 '(?, 4) 的 Tensor 'Placeholder_1:0' 的 ValueError : Cannot feed value of shape (230, )

regex - 使用 BASH 中的 shell 脚本在正则表达式上将一个大的 txt 文件拆分为 200 个较小的 txt 文件

python - 在 Python 中读取带有特殊字符的参数时出现问题

python - Pandas 爆炸功能无法正常工作

python - 在 NumPy 数组上计算 "moving sum of counts"

python pygame让外星人群体移动