如何在32位安装Python软件包,但在64位上也可以在视觉代码上使用?例如Pytorch

发布于 2025-01-23 13:33:36 字数 504 浏览 1 评论 0原文

我用 (1)64位的Windows 11,

(2)Python 3.7.8; python 3.8.3 for 32bit

(3)Visual Studio代码。

我注意到我所有的Python包都安装在32bit上,是否有任何方法可以使我的包裹在64位上工作?,因为我希望使用 pytorch ,但是仅在64位上工作,

我还在视觉代码中安装了 pytorch ,但是它没有安装在我的python环境中...为什么?

我试图通过PIP安装 pytorch ,它给了我以下错误:

I use
(1) Windows 11,

(2) Python 3.7.8 for 64bit ;
Python 3.8.3 for 32bit

(3) Visual Studio Code.

I noticed that all my python packages are installed on 32Bit, is there any way to get my packages works on 64bit as well? Because I wish to use Pytorch, however, it only works on 64bit

I also installed PyTorch in Visual code, but it does not appear installed in my python environment...Why?

I tried to install PyTorch by pip and it gives me error as below:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟─花易冷 2025-01-30 13:33:36

您已经在jupyter笔记本中选择了python3.7.8(64),而在python3.8.3(32)环境中安装了Python模块。因此,它将提示没有名为“ pandas”的模块。

看起来Torch没有32位版本,如果要使用它,则需要选择Python3.7.8(64)

因此,您可以首先通过打开Python文件来激活终端,然后单击Vscode右下方的Python解释器,或选择python:选择Python Instracter

然后,进行 ctrl+Shift+`的快捷方式,以创建具有激活的Python环境的新终端。之后,您可以在正确的位置安装模块。

您可以参考官方文档 for更多细节。

You have selected Python3.7.8(64) in the jupyter notebook, while you have installed the python modules in the Python3.8.3(32) environment. So it will prompt No module named 'pandas'.

And looks like torch has no 32bit version, if you want to use it, you need to select Python3.7.8(64).

So, you can activate the terminal first through open a python file and then clicking the python interpreter on the bottom-right of the VSCode or choosing Python: Select Python interpreter in the command palette directly.

Then take the shortcut of Ctrl+Shift+` to create a new terminal with the activated python environment. After this, you can install the modules in the right place.

You can refer to the official docs for more detail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文