@
noahjsn 用了你的命令测试也是 OK 的。(中间有个报错,因为我用的是 fish shell ,激活虚拟环境时要用 fish 脚本)
~/PlayGround
❯ cd my-demo-project-1/
my-demo-project-1 [ main][?][ v0.1.0][ v3.9.6]
❯ uv venv
Using CPython 3.14.3
Creating virtual environment at: .venv
Activate with: source .venv/bin/
activate.fishmy-demo-project-1 [ main][?][ v0.1.0][ v3.9.6]
❯ source .venv/bin/activate
.venv/bin/activate (line 26): Unsupported use of '='. In fish, please use 'set _OLD_SCRIPT_PATH "$SCRIPT_PATH"'.
_OLD_SCRIPT_PATH="$SCRIPT_PATH"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
from sourcing file .venv/bin/activate
source: Error while reading file '.venv/bin/activate'
my-demo-project-1 [ main][?][ v0.1.0][ v3.9.6]
❯ source .venv/bin/
activate.fishmy-demo-project-1 [ main][?][ v0.1.0][ v3.14.3(my-demo-project-1)]
❯ uv add fastapi
Resolved 11 packages in 3.69s
Prepared 2 packages in 1.99s
Installed 10 packages in 16ms
+ annotated-doc==0.0.4
+ annotated-types==0.7.0
+ anyio==4.13.0
+ fastapi==0.135.3
+ idna==3.11
+ pydantic==2.13.0
+ pydantic-core==2.46.0
+ starlette==1.0.0
+ typing-extensions==4.15.0
+ typing-inspection==0.4.2