输入老师给的下载pytorch和torchvision的命令报错找不到版本
pip install torch==1.4.0 torchvision==0.5.0 -i https://pypi.douban.com/simple
报错:
could not find a version that satisfies the requirement torch
然后找教程去它的whl下载的网址下载,我直接下载放到D盘
- 下载后打开命令行
- 进入对应下载地址(D:)
- 输入下方命令
pip install torch-1.4.0+cpu-cp38-cp38-win_amd64.whl
报错:ERROR: torch-1.4.0+cpu-cp38-cp38m-win32.whl is not a supported wheel on this platform.
解决方法:
在自己的python文件夹的site-packages中寻找pep425tags.py文件
我的在Python\Lib\site-packages\setuptools里面
所以
import setuptools.pep425tags #根据自己pep425tags文件位置进行相应更改
print(setuptools.pep425tags.get_supported())
通过这里可以发现上面下载的文件名格式是不支持的,我试了两种文件格式,发现修改为:pip install torch-1.4.0+cpu-cp38-none-win32.whl,安装成功
同同样的方法下载torchvisioni
但是
import torch