gpt4 book ai didi

python - 无法在 Ubuntu 中使用 setup.py 中的 Github Actions 安装 Tensorflow 2.2.0rc0

转载 作者:行者123 更新时间:2023-12-03 18:40:12 27 4
gpt4 key购买 nike

当我尝试从 setup.py 安装 tensorflow>=2.2.0rc0 从 Github Actions Workflow 运行 python setup.py install , 输出发送给我:

Searching for tensorflow>=2.2.0rc0
Reading https://pypi.org/simple/tensorflow/
No local packages or working download links found for tensorflow>=2.2.0rc0
error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.2.0rc0')
##[error]Process completed with exit code 1.

这是我的 Github Action 工作流程:

name: Test Deblurrer

on:
push:
branches:
- master
- development
pull_request:
branches:
- master
- development

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
sudo apt-get install libpq-dev python-dev
python -m pip install --upgrade pip
python setup.py install
pip install pytest

- name: Test with pytest
run: |
PYTHONPATH=${PYTHONPATH}:/home/runner/work/deep-deblurring/deep-deblurring/backend:$(pwd)
pytest

接下来是我的setup.py:

#!/usr/bin/python
# coding=utf-8

"""Setup and install the package and all the dependencies."""

from setuptools import setup, find_packages

with open('requirements.txt') as pro:
INSTALL_REQUIRES = pro.read().split('\n')

setup(
author='Whitman Bohorquez, Mo Rebaie',
author_email='whitman-2@hotmail.com',
name='deblurrer',
license='MIT',
description='Image Deblurring using Deep Learning Architecture',
version='1.0.0',
url='',
packages=find_packages(),
include_package_data=True,
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
classifiers=[
'Development Status :: Alpha',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Intended Audience :: Developers',
],
)

最后,我的 requirements.txt:

grpcio == 1.27.2
kaggle
numpy
tensorflow >= 2.2.0rc0
pandas

我不明白为什么在 Github Actions 上会发生这种情况,但是在 Windows 10 上本地安装时它会按预期工作。

提前致谢!

PD:当我直接在 Github Action Workflow 上执行 pip install tensorflow==2.2.0rc0 时,而不是在 python setup.py install 中,它也能正常工作。所以这不适用于 setup.py,并且仅适用于 Ubuntu

最佳答案

问题出在过时的 setuptools 版本上。从 2.0 开始,tensorflow 仅在 Linux 上提供带有 manylinux2010 标签的轮子。 setuptools 添加了对 manylinux2010 的支持 in 42.0.0 ,因此升级 setuptools 将解决问题:

$ pip install setuptools>=42.0.0

关于python - 无法在 Ubuntu 中使用 setup.py 中的 Github Actions 安装 Tensorflow 2.2.0rc0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60729752/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com