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
基础教程推荐
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
