I've got a strange problem in python - code shows an error.
Numpy has an error?
“AttributeError: module 'numpy.random' has no attribute '_bit_generator'”
The above error indicates a function does not exist in the numpy library. This particular error is introduced in numpy 1.18.
To resolve this use any of these options:
Dockerfile:
RUN pip install "numpy>=1.19
Command-line:
pip install "numpy>=1.19"
Edit or create a file in your Files named: requirements.txt, add:
numpy>=1.19
For more examples you can add scope to the versions min/max:
pip install "numpy>1.18, <=1.20" # Will install 1.20 unless some other requirements stop you from that.
pip install "numpy>1.18, <1.20" # Will install 1.19.X
When using < or > you must enclose the package and version in quotes for reliable operation since it can be interpreted as redirection symbol.
Comments
0 comments
Please sign in to leave a comment.