Python3.12及后续版本中使用PyCharm报错:找不到Python打包工具’setuptools’
Python3.12及后续版本中 使用PyCharm 报错 Error: Python packaging tool ‘setuptools‘ not found
可能的原因是 Python3.12 版本后 venv 虚拟环境不再自带 setuptools 包, 导致 PyCharm 部分功能无法正常运行
Python官方说明:
gh-95299: 不在使用 venv 创建的虚拟环境中预装 setuptools。 这意味着 distutils、setuptools、pkg_resources 和 easy_install 默认将不再可用;
官方解决方法: 手动在终端安装 setuptools 包
在激活的 venv 虚拟环境中执行下列命令
pip install setuptools
安装 setuptools 包后恢复正常