无法在Google AI平台(CMLE)上安装pycocotools

问题描述 投票:2回答:1

[在AI平台上安装trainer软件包时收到此错误,

追踪(最近一次通话):文件“”,第1行,在文件“ /tmp/pip-install-_u8thvm6/pycocotools/setup.py”,行2,在从Cython.Build中导入cythonize ImportError:否名为“ Cython”的模块]]

尽管我在'Cython'中加入了setup.py

setup.py:

import setuptools

NAME = 'trainer'
VERSION = '1.0'
REQUIRED_PACKAGES = [
    'Cython', # Cython, mentioned before pycocotools
    'tensorflow-gpu',
    'google-cloud-storage',
    'gcsfs',
    'pycocotools'
]

setuptools.setup(
    name=NAME,
    version=VERSION,
    packages=setuptools.find_packages(),
    install_requires=REQUIRED_PACKAGES,
    include_package_data=True,
    description='Trainer package')

我在AI平台上安装教练包时出现此错误,回溯(最近一次调用是最近的):文件“”,第1行,在文件“ /tmp/pip-install-_u8thvm6/pycocotools/setup.py”中,第2行,...

python cython google-cloud-ml gcp-ai-platform-training pycocotools
1个回答
0
投票

[您需要在运行setup.py之前安装cython。问题在于,cython是在构建时需要的,而不是在运行时需要的,并且无法保证您在install_requires中列出的pqckages的安装顺序。因此,当pip尝试安装pycocotools时,它尚未安装cython并中止。

© www.soinside.com 2019 - 2024. All rights reserved.