我正在使用 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/