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


- 计算测试数量的Python单元测试 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01