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.

Raspberry Pi 4 aarch64: ModuleNotFoundError: No module named 'numpy.random.bit_generator'

See original GitHub issue

I’m using the NLU framework Rasa using TensorFlow which is relying on scipy. I have no issues running the code on a amd64 platform, but I’m using a Raspberry Pi 4 aarch64 architecture, where I hit the problem:

ModuleNotFoundError: No module named ‘numpy.random.bit_generator’

I thought recompiling everything would fix this issue with:

pip3 install scipy==1.7.1 numpy==1.18.5 scikit-learn==0.24.2 --no-cache-dir --no-binary :all:

but I get the same error.

I cannot update at least numpy, because version 1.19 is introducing some breaking changes and TensorFlow does not work anymore.

Reproducing code example:

The problem can be also reproduced by executing in a Python 3 shell:

mkdir test
cd test
python3 -m venv venv
source venv/bin/activate
pip3 install scipy==1.7.1 numpy==1.18.5 scikit-learn==0.24.2
python3

Within the Python 3 shell execute:

import scipy.stats

Error message:

>>> import scipy.stats
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/accessibility/a/venv/lib/python3.8/site-packages/scipy/stats/__init__.py", line 441, in <module>
    from .stats import *
  File "/home/ubuntu/accessibility/a/venv/lib/python3.8/site-packages/scipy/stats/stats.py", line 43, in <module>
    from . import distributions
  File "/home/ubuntu/accessibility/a/venv/lib/python3.8/site-packages/scipy/stats/distributions.py", line 11, in <module>
    from . import _discrete_distns
  File "/home/ubuntu/accessibility/a/venv/lib/python3.8/site-packages/scipy/stats/_discrete_distns.py", line 19, in <module>
    from .biasedurn import (_PyFishersNCHypergeometric,
  File "biasedurn.pyx", line 1, in init scipy.stats.biasedurn
ModuleNotFoundError: No module named 'numpy.random.bit_generator'

Scipy/Numpy/Python version information:

1.7.1 1.18.5 sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
rgommerscommented, Aug 5, 2021

What a mess. The attitude of the TensorFlow maintainers is that it’s just not important for them. Both the bug and the unwillingness to fix it are 100% on their side.

1reaction
rgommerscommented, Apr 25, 2022

Good point Tirth. If one waits long enough, some problems fix themselves:)

In this case, let’s close it when we drop numpy 1.18.x support, which we can do for the next release. No need to backport to 1.8.1 anymore I’d say.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'numpy.random ...
Running the following line, forced to reinstall the numpy package. Since the package was somehow corrupted, it was fixed.
Read more >
No module named 'numpy.random.bit_generator' - Streamlit
I am trying to deploy a model but it keeps giving me an error warning ModuleNotFoundError: No module named 'numpy.random.bit_generator'.
Read more >
No Module Named Github On Raspberry Pi - ADocLib
I have no issues running the code on a amd64 platform but I'm using a Raspberry Pi 4 aarch64: ModuleNotFoundError: No module named....
Read more >
NUMPY LIBRARY CANNOT BE FOUND - Raspberry Pi Forums
"ModuleNotFoundError : No module named 'numpy'". ... I'm trying to execute a program in Python 3.7.4, which requires numpy library.
Read more >
ModuleNotFoundError: No module named 'wxpython' Code Example
Answers related to “ModuleNotFoundError: No module named 'wxpython'” ... AttributeError: module 'numpy.random' has no attribute 'BitGenerator' ...
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