【问题标题】:Import issue while using the python setuptools library使用 python setuptools 库时的导入问题
【发布时间】:2021-07-13 19:09:23
【问题描述】:

我正在使用 python 库 setuptools。我收到此错误:

ImportError: numpy>=1.17 is required for a normal functioning of this module, but found numpy==1.16.5.
Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git master

但是,我已经在安装文件中声明了 numpy 版本为 1.17:

%%writefile custom/setup.py
from setuptools import find_packages
from setuptools import setup

REQUIRED_PACKAGES = ['torch>=1.5', 'scikit-learn>=0.20', 'pandas', 'transformers', 'numpy>=1.17', 'tensorboard']

setup(
    name='trainer',
    version='0.1',
    install_requires=REQUIRED_PACKAGES,
    packages=find_packages(),
    include_package_data=True,
    description='My training application package.'
)

那么,安装文件有问题吗?

【问题讨论】:

    标签: python setuptools google-ai-platform


    【解决方案1】:

    问题可能是numpy>=1.17之后 transformer,所以安装transformer 时numpy 仍然停留在1.16.5。
    我还没有深入研究 setuptools,所以这只是一个猜测:)

    【讨论】:

    • 可以,我试试!谢谢
    猜你喜欢
    • 1970-01-01
    • 2012-04-08
    • 2011-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-01
    • 2023-02-24
    • 2017-01-20
    相关资源
    最近更新 更多