如何获得之前安装的 32 位 python 包,但在 Visual Code 中也适用于 64 位?例如。火炬

How to get python packages installed for 32 bit before but works on 64bit as well in Visual Code? E.g. Pytorch

我用 (1) Windows 11,

(2) Python 64 位 3.7.8; Python 32 位 3.8.3

(3) Visual Studio 代码.

我注意到我所有的 python 软件包都安装在 32 位上,有什么方法可以让我的软件包也能在 64 位上运行吗? 因为我想使用Pytorch,然而,它只适用于 64 位

我尝试再次安装软件包,但它是为我的 32 位安装的?所以它不能重新安装?

我检查了我的系统路径,但我不知道如何处理我的包的路径?

我还在 Visual code 中安装了 PyTorch,但它没有出现在我的 python 环境中...为什么?

我尝试通过 pip 安装 PyTorch,但出现如下错误:

更新:-------------------------------- -------------- 我试过:Ctrl+Shift+P, select 即 64bit python

然后,在终端我尝试安装包,它仍然显示我的包已经安装...

您在 jupyter notebook 中 selected Python3.7.8(64),同时在 Python3.8.3(32) 环境中安装了 python 模块。所以会提示No module named 'pandas'.

而且好像torch没有32位的版本,如果要用,需要select Python3.7.8(64).

因此,您可以先打开一个 python 文件,然后单击 VSCode 的 bottom-right 上的 python 解释器或选择 Python: Select Python interpreter 直接在命令面板中。

然后使用 Ctrl+Shift+` 的快捷方式创建一个新终端,并激活 python 环境。在此之后,您可以在正确的位置安装模块。

详情请参考official docs