Python 错误:无法使用 python 创建进程访问被拒绝

问题描述 投票:0回答:1

环境

我安装了 python 3.11.x 和 3.12.x。但我发现 3.11.x 与一般事物更兼容,而 3.12.x 还不是主流。抱歉,如果描述得不好,但我认为大致正确。

问题

在 vscode 中,我收到以下错误:

vscode> py
Unable to create process using 
'"C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\python3.12.exe"': 
Access is denied.

我尝试过的

在调色板中选择 3.11.x,带有

Python: Select Interpreter

卸载所有版本的python,然后重新安装3.11.x。

检查了系统属性中的 Windows 环境变量,但没有看到任何有关 python 的信息。 enter image description here

仍然出现同样的错误。

python visual-studio-code
1个回答
0
投票

打开Python 3.12安装程序并选择卸载

enter image description here

enter image description here

您还可以使用Python 3.11在工作区创建虚拟环境,选择虚拟环境解释器,然后创建一个新终端来激活环境。

此外,您只需输入

python
而不是
py

© www.soinside.com 2019 - 2024. All rights reserved.