Dependency
Also: 依賴 · 依賴套件 · dependencies · lockfile · 鎖定檔 · 版本衝突
For your program to work, other people's programs must already be present. Those prerequisites are its dependencies.
When you will meet it
Most AI tool install failures are dependency failures: one is missing, one is the wrong version, or two packages each demand an incompatible version. Without this word you keep assuming you typed the command wrong, when what actually needs fixing is a list.
An analogy
Like an ingredient list. The recipe is not the dish, and missing any one item means nothing comes out; and each ingredient in turn has its own source and specification — the trouble with dependencies is that the list keeps growing downward.
Minimal example
你直接宣告的: openai
openai 自己需要的: httpx、pydantic、anyio…
pydantic 又需要: annotated-types、pydantic-core…
──────────────────────────────────────────────
你只寫了一行,pip 實際裝了十幾個套件
宣告清單 requirements.txt(npm 那邊是 package.json)
鎖定檔 package-lock.json(npm)—— 記下每個套件「確切裝到哪一版」The point is that you declared one layer and received many. So when something breaks, the culprit is often a package you never installed yourself. A lockfile exists so that next time — and on someone else's machine — exactly the same set of versions comes back.
What people get wrong
- Assuming newest is always best. Packages in the AI ecosystem often specify version ranges, and one too-new dependency can break the whole chain. Following a guide's pinned versions is not timidity, it is necessary.
- Deleting the lockfile as clutter, or adding it to .gitignore. It is the record that this exact combination worked; without it everyone installs something different and debugging turns into guesswork.
Related terms
Next
- 五分鐘設置你的 LLM 開發環境15 minChinese only
- Triple Strike: OMP Error #15, PEP 668, and Python Dependency Hell23 min