question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to import transformers: ImportError: numpy>=1.17 is required for a normal functioning of this module, but found numpy==1.16.3

See original GitHub issue

I’d installed transformers via pip install transformers

And made sure my python packages is up-to-date, however when I import transformers it shows the error message:

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

I’d made sure my numpy is version 1.20.1, and I’d tried as suggested in the message: pip install transformers -U

But it doesn’t work. Please help me how could I import the package, thank you!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
laurence-lincommented, May 19, 2021

Probably your environments have different versions as @LysandreJik mentioned. Can you run the following command where you get the error message (your working environment), and assure you have the correct numpy version.

pip freeze | findstr "numpy"

You may try the following, but without locating your correct environment these probably do not help much.

pip install -I transformers --no-cache-dir --force-reinstall

Your second instruction works! It seems force-install may install all dependencies for transformer, but I still don’t know why it couldn’t run with the default numpy = 1.20.0

Thank you for your help!

2reactions
devrimcavusoglucommented, May 14, 2021

Probably your environments have different versions as @LysandreJik mentioned. Can you run the following command where you get the error message (your working environment), and assure you have the correct numpy version.

pip freeze | findstr "numpy"

You may try the following, but without locating your correct environment these probably do not help much.

pip install -I transformers --no-cache-dir --force-reinstall
Read more comments on GitHub >

github_iconTop Results From Across the Web

Import issue while using the python setuptools library
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 ...
Read more >
Problem installing using conda - Hugging Face Forums
I'm trying to install transformers and datasets package using conda. I installed pytorch using conda, and I'm using miniconda with python ...
Read more >
2022 How to Fix ImportError "No Module Named Numpy" Error ...
2022 How to Fix "No Module Named Numpy" Error in Python! How to fix the error in PyCharm and running scripts from command...
Read more >
python ImportError: No module named numpy - YouTube
python ImportError : No module named numpysudo pip install numpysudo pip3 install numpysudo apt-get install python3-pipPython Tutorials ...
Read more >
fullresults.2013-05-13.txt - debian.org Developers LDAP Search
Posix' could not be found avalon-framework 4.2.0-9 OK ... cloud-init 0.7.1-3 Failed [PYTHON_TRACEBACK/PYIMPORT] ImportError: No module named setuptools ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found