python - 在 mac 终端中执行命令时出现奇怪的语法错误
问题描述
每次我尝试执行某些命令(例如 'pyenv 版本' 或通过执行命令 'code .' 打开 vs 代码)时,这两个命令都会导致相同的奇怪错误:
Syntax Warning: May not be a PDF file (continuing anyway)
Syntax Error: Couldn't read xref table
Syntax Warning: PDF file is damaged - attempting to reconstruct xref table...
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table
为什么这些命令完全被解释为 pdf 文件?这是其中一个命令运行的屏幕截图:
此外,当我从 .bash_profile 中删除以下内容时,“pdftotext 3.04 版”和其他行将从终端中消失:
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
因此,从 .bash_profile 中删除上述行后,终端如下所示:
另外,当我运行命令'set -x; 代码 。',我得到以下信息:
Last login: Wed Jul 31 15:10:24 on ttys001
martand ~ $ set -x; code .
+ code .
Syntax Warning: May not be a PDF file (continuing anyway)
Syntax Error: Couldn't read xref table
Syntax Warning: PDF file is damaged - attempting to reconstruct xref table...
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table
++ update_terminal_cwd
++ local url_path=
++ local i ch hexch LC_CTYPE=C LC_ALL=
++ (( i = 0 ))
++ (( i < 14 ))
++ ch=/
++ [[ / =~ [/._~A-Za-z0-9-] ]]
++ url_path+=/
++ (( ++i ))
++ (( i < 14 ))
++ ch=U
++ [[ U =~ [/._~A-Za-z0-9-] ]]
++ url_path+=U
++ (( ++i ))
++ (( i < 14 ))
....
++ return 1
解决方案
推荐阅读
- python - Python Pandas to_csv,能不能用.replace() 抢先处理双引号转义问题
- java - 为什么我无法使用 StringTokenizer 访问第二个令牌?
- r - 如何覆盖@运算符以访问 R 中 S4 对象的插槽
- database - mongorestore时MongoDB如何处理Object ID重叠?
- matlab - 梯度下降 - 逻辑回归 - 奇怪的 thetas
- excel - 粘贴新数据时 Excel 表格公式范围错误地递增
- android-studio - 尝试运行 Android 应用程序时出现 INSTALL_FAILED_MISSING_SHARED_LIBRARY 错误
- postgresql - 在 Windows 上为 PostgreSQL 注册事件日志时出错
- bash - 如何将动态数量的参数传递给 sed 以用作过滤器
- jquery - 需要将 onblur 更改为 onclick 的说明