【发布时间】:2021-04-18 12:48:15
【问题描述】:
我同时安装了 64 位和 32 位 Python。我试图使用 VSCode 中的 32 位 Python.exe 文件创建一个虚拟环境。我在 Python 中选择了该版本:为我的工作区选择解释器(即 C:\Program Files (x86)\Python37-32\python.exe)。
然后我更改了工作区中的 launch.json 文件以包含“python”解释器:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"python": "c:/Program Files (x86)/Python37-32/python.exe"
}
]
}
但是,当我创建虚拟环境时:
py -3 -m venv 32_bit_env
它使用的 python 解释器是来自 C:\Program Files\Python37\python.exe 的 64 位版本,如 pyvenv.cfg 所示:
home = C:\Program Files\Python37
是否有其他位置可以更改工作区中 python.exe 文件的目录?谢谢!
【问题讨论】:
标签: python windows visual-studio-code python-venv