You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac终端执行python命令时asdf提示文件不存在的原因排查

错误原因分析:asdf文件缺失导致python命令执行失败

终端错误信息

/Users/mattlaszcz/.asdf/shims/python: line 3: 
/opt/homebrew/Cellar/asdf/0.11.0/libexec/bin/asdf: No such file or directory
/Users/mattlaszcz/.asdf/shims/python: line 3: exec: 
/opt/homebrew/Cellar/asdf/0.11.0/libexec/bin/asdf: cannot execute: No such file or directory

缺失原因

  • asdf版本已更新或卸载:通过Homebrew安装的asdf 0.11.0版本已被升级到更高版本,或被彻底卸载,但.asdf/shims/python脚本仍引用旧版本的路径。Homebrew更新软件时会替换旧版本目录,卸载则直接删除对应版本文件夹。
  • asdf安装目录被手动改动:/opt/homebrew/Cellar/asdf/0.11.0目录被手动移动、删除或重命名,导致脚本中的硬编码路径失效。
  • shims脚本未同步更新:asdf版本变更后,对应的shims脚本未重新生成,仍然指向旧版本的asdf执行文件。shims是asdf管理多版本软件的中间脚本,版本变更后需重新生成才能匹配正确路径。

内容的提问来源于stack exchange,提问作者Matt Laszcz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 12:04:51