简体   繁体   中英

Import issue while using the python setuptools library

I am using the python library setuptools. I am getting this error:

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

However, I am already declaring numpy with the version 1.17 in the setup file:

%%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.'
)

So, is something wrong with the setup file?

The problem may be numpy>=1.17 coming after transformer , so numpy still stays at 1.16.5 when transformer is installed.
I haven't dug into setuptools, so it's just a guess:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM