Python - UV PyCharm 不能识别 .venv 的环境

Python - UV 为每个项目创建独立、干净的Python工作空间

使用 uv run 可以运行 py 文件,但 PyCharm 不能识别 Python 环境

PS D:\OpenSource\Python\VipPython> uv python install 3.12
Python 3.12 is already installed
PS D:\OpenSource\Python\VipPython> uv run .\sync_device\repeating_sn.py
hello,world! 

image

File -> Settings -> Project: XXX -> Python Interpreter -> Add Interpreter -> Add Local Interpreter
image

选择 New 新环境
image
image

运行环境里就会出现配置的对应当前项目的 Python 环境
image

点击运行
image

posted @ 2026-01-07 13:42  VipSoft  阅读(7)  评论(0)    收藏  举报