python - 使用 python setuptools 库时的导入问题

标签 python setuptools google-ai-platform

我正在使用 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
但是,我已经在安装文件中使用 1.17 版声明了 numpy:
%%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.'
)
那么,安装文件有问题吗?

最佳答案

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

关于python - 使用 python setuptools 库时的导入问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67164501/

相关文章:

r - 谷歌云AI平台jupyter notebook实例重启后也打不开,正在运行

python - 我在 pytorch "RuntimeError: invalid argument 2: size ' [-1 x 400] 上收到此错误

python - 使用 cron 作业执行 python3 文件。

python - 如何从自定义人工智能平台模型登录

javascript - 多语言库的 python 位的文件布局和 setuptools 配置

python - 将 argparse 与 Setuptools entry_points 一起使用

python - 我如何在 Yocto/Bitbake 的另一个食谱中引用/找到一个食谱的 ${PV}?

python - 如何读取文本文件并转换为字典?

python - 降级 Python Setuptools