Can#39;t install pytorch with pip on Windows(无法在 Windows 上使用 pip 安装 pytorch)
问题描述
我正在尝试在 Windows 上安装 Pytorch,我正在使用官方网站的命令https://pytorch.org/get-started/locally/
I'm trying to install Pytorch with Windows and I'm using the commands of the official site https://pytorch.org/get-started/locally/
pip3 install torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html
这是我选择 Windows、Cuda 10.0 和 Python 3.7 时的命令但是如果我运行它,我会收到错误消息:
This is the command if I choose Windows, Cuda 10.0, and Python 3.7 But if I run this I get the error message:
ERROR: Could not find a version that satisfies the requirement torch==1.2.0 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch==1.2.0
那为什么会这样呢?我的 pip 是 19.2 版本,我在新安装的 python 3.7 环境中
So why does this happen? My pip is version 19.2 and I am in a newly installed python 3.7 environment
推荐答案
您的问题最可能的原因是 Python 的 32 位安装,而 Torch 库依赖于 64 位版本.我遇到了完全相同的问题.
The most likely reason for Your issue is a 32-bit installation of python, while the torch libraries rely on having a 64-bit version. I had exactly the same issue.
只需从命令行启动 python 并观察
Just start python from command line and observe
C:Usersmarci>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
我的安装现在显示 64 位.如果 Yours 显示 32,则安装 64 位 python.我使用了这个链接:Official python 64-bit Windows安装程序
My installation now shows 64 bits. If Yours shows 32, then install 64-bit python. I used this link: Official python 64-bit Windows installer
这篇关于无法在 Windows 上使用 pip 安装 pytorch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法在 Windows 上使用 pip 安装 pytorch
基础教程推荐
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 包装空间模型 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
