pip - 如何在虚拟环境中的 Windows 上使用 pip 和 python 3.8.3 安装 torch 和 torchvision?
问题描述
我为我的项目创建了一个虚拟环境,我正在尝试torch
通过pip
.
pip install torch===1.5.1 torchvision===0.6.1 -f https://download.pytorch.org/whl/torch_stable.html
这给了我错误-
ERROR: Could not find a version that satisfies the requirement torch===1.5.1 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch===1.5.1
有的解决方案推荐使用conda,有必要吗?我能不能做到pip
解决方案
您可以尝试直接从 wheel 文件中安装:
pip install https://download.pytorch.org/whl/cu102/torch-1.5.1-cp36-cp36m-win_amd64.whl
pip install https://download.pytorch.org/whl/cu102/torchvision-0.6.1-cp36-cp36m-win_amd64.whl
推荐阅读
- bash - bash中文本文件中的数字修改
- python - 这个 python 代码如何使用正则表达式 sub() 和 group() 将字符串转换为 camelCase?
- python - 从一组具有混合数值类型的范围创建一个 DataFrame
- javascript - onChange 未使用来自 ReactDOMServer.renderToString 的对象触发
- cordova - 华为移动服务支持哪些混合应用?
- java - Spring框架HttpMessageNotReadableException:缺少所需的请求正文
- animation - 如何从单击一个对象开始制作多个动画?
- java - 我想让我的 actionlistener 在一个单独的类上,但它似乎不起作用
- gradle - Kotlin 编译在终端中失败,但不是 Intellij
- java - 无论我身在何处,我的应用程序都会返回相同的位置