【发布时间】:2020-10-16 19:41:29
【问题描述】:
我在通过pipenv 安装python 包flair 和pytorch 时遇到问题,并且还不能解决这个问题。由于我正在尝试使用 Pipfile + Pipfile.lock 而不是 requirements.txt 对我的 python git 存储库进行版本控制,因此目前这是不可能的:
pipenv install flair
ERROR: Could not find a version that satisfies the requirement torch>=1.1.0 (from flair->-r c:\users\user.name\appdata\local\temp\pipenv-plyx3uwp-requirements\pipenv-xh_afa_r-requirement.txt (line 1)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2) ERROR: No matching distribution found for torch>=1.1.0 (from flair->-r c:\users\user.name\appdata\local\temp\pipenv-plyx3uwp-requirements\pipenv-xh_afa_r-requirement.txt (line 1)) Installation Failed
我尝试了这些安装torchvision的变体:
pipenv install torchvision
安装torchvision 应该获取最新的torch版本
pipenv install torch==1.3
安装手电筒
pipenv install https://download.pytorch.org/whl/cu92/torch-0.4.1-cp37-cp37m-win_amd64.whl
安装torch的替代方法(这里有更多二进制文件:https://pytorch.org/get-started/previous-versions/#windows-binaries)
pipenv install git+https://github.com/pytorch/vision#egg=torchvision
另一种方法,
错误文本:正在收集 torchvision 下载 torchvision-0.5.0-cp37-cp37m-win_amd64.whl (1.2 MB) 收集 numpy 使用缓存的 numpy-1.18.5-cp37-cp37m-win_amd64.whl (12.7 MB) 采集枕>=4.1.1 下载 Pillow-7.1.2-cp37-cp37m-win_amd64.whl (2.0 MB) 收集六个 下载 6-1.15.0-py2.py3-none-any.whl (10 kB)
pipenv install torchvision
users\user.name\appdata\local\temp\pipenv-hf2be0xq-requirements\pipenv-57akhz4j-requirement.txt(行 1))(来自版本:0.1.2、0.1.2.post1、0.1.2.post2) 错误:未找到 torch==1.4.0 的匹配分布(来自 torchvision->-r c:\users\user.name\appdat a\local\temp\pipenv-hf2be0xq-requirements\pipenv-57akhz4j-requirement.txt(第 1 行) 安装失败
可以安装 torchvision 的唯一方法是不使用它的依赖包:
pipenv run pip install --no-deps torchvision
但这并没有解决通过 pipenv 安装 flair 的问题,因为需要依赖项。
【问题讨论】:
-
提供您的 Python 版本。
torchpython 包在很多 Python 版本中不可用。 -
感谢您的回答。我有以下python版本:python 3.7.5 64bit
-
能否创建一个新环境并运行
pipenv install torch==1.3.1。输出是什么? -
同样的错误:
ERROR: Could not find a version that satisfies the requirement torch==1.3.1 (from -r c:\users\user.name\appdata\local\temp\pipenv-fg5mza4n-requirements\pipenv-_7xxn7ek-requirement.txt (line 1)) (from versions : 0.1.2, 0.1.2.post1, 0.1.2.post2) ERROR: No matching distribution found for torch==1.3.1 (from -r c:\users\user.name\appdata\local\temp\pipenv-fg5mza4n-requirements\pipenv-_7xxn7ek-requirement.txt (line 1))
标签: python pytorch pipenv pipfile flair