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.

ModuleNotFoundError: No module named 'numpy._globals'

See original GitHub issue

The platform I use and the version of the installation package

[user@localhost nuitka_test]$ cat /proc/version
Linux version 3.10.0-1160.6.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Nov 17 13:59:11 UTC 2020
[user@localhost nuitka_test]$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[user@localhost nuitka_test]$ python -m nuitka --version
0.6.12.3
Python: 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51)
Executable: /home/user/anaconda3/bin/python
OS: Linux
Arch: x86_64

The third-party dependency package I use is:

pip install \
numpy==1.16.6 \
flask flask_restful \
opencv-python scikit-learn \
pdfplumber pandas gevent Scipy \
tensorflow==2.2.0 keras \

My nuitka installation method:pip install nuitka.

I look up numpy in the system as follows:

[user@localhost ocr_server_nuitka]$ sudo find / -name "numpy"
[sudo] password for user:
/home/user/anaconda3/pkgs/numpy-base-1.19.2-py36hfa32c7d_0/lib/python3.6/site-packages/numpy
/home/user/anaconda3/pkgs/numpy-base-1.19.2-py36hfa32c7d_0/lib/python3.6/site-packages/numpy/core/include/numpy
/home/user/anaconda3/pkgs/cython-0.28.2-py36h14c3975_0/lib/python3.6/site-packages/Cython/Includes/numpy
/home/user/anaconda3/pkgs/pandas-0.23.0-py36h637b7d7_0/lib/python3.6/site-packages/pandas/compat/numpy
/home/user/anaconda3/pkgs/astropy-3.0.2-py36h3010b51_1/lib/python3.6/site-packages/astropy/utils/compat/numpy
/home/user/anaconda3/lib/python3.6/site-packages/numpy
/home/user/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy
/home/user/anaconda3/lib/python3.6/site-packages/Cython/Includes/numpy
/home/user/anaconda3/lib/python3.6/site-packages/pandas/compat/numpy
/home/user/anaconda3/lib/python3.6/site-packages/astropy/utils/compat/numpy
/home/user/anaconda3/lib/python3.6/site-packages/tensorflow/include/external/local_config_python/numpy_include/numpy
/home/user/nuitka_test_01/o/test_numpy.dist/tensorflow/include/external/local_config_python/numpy_include/numpy
/home/user/nuitka_test_01/o/test_numpy.dist/numpy
/home/user/nuitka_test_01/o/test_numpy.dist/numpy/core/include/numpy
/home/user/ocr_server_nuitka/dist_pyinstaller_ok/ocr_server/numpy
/home/user/ocr_server_nuitka/o/ocr_server.dist/numpy
/home/user/ocr_server_nuitka/o/ocr_server.dist/numpy/core/include/numpy
[user@localhost ocr_server_nuitka]$

I copied the entire numpy folder and all the contents in the folder and started the program. An error was reported

cp -r /home/user/anaconda3/lib/python3.6/site-packages/numpy /home/user/ocr_server_nuitka/o/ocr_server.dist/
cd /home/user/ocr_server_nuitka/o/ocr_server.dist/
./ocr_server

error information

    from ._globals import ModuleDeprecationWarning, VisibleDeprecationWarning
ModuleNotFoundError: No module named 'numpy._globals'

How can I solve this problem? Thank you very much

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
William1Wucommented, Feb 15, 2022

I have the same problem on Win10 using anaconda environment. Please help me, thanks.

  • python 3.8
  • nuitka 0.6.19.7(latest)
  • numpy 1.22.2 (latest)
0reactions
kayhayencommented, Feb 15, 2022

@William1Wu please create a new issue, I need more information apparently.

Read more comments on GitHub >

github_iconTop Results From Across the Web

numpy 1.9.3, ImportError: No module named _globals
I encountered similar problems when using numpy 1.7 in python 2.7. It is simply because lower version of numpy is only compatible with...
Read more >
No module named 'numpy._globals' · Issue #10707 - GitHub
I have an issue using numpy 1.10.4 with python 3.5.0. Numpy installed with conda on windows 10 (testenv) C:\WINDOWS\system32>python Python ...
Read more >
ModuleNotFoundError: No module named 'numpy' in Python
The Python "ModuleNotFoundError: No module named 'numpy'" occurs when we forget to install the numpy module before importing it or install ...
Read more >
[Solved] No Module Named Numpy in Python
This error mainly arises due to the unavailability of files in the Python site-packages. This error is easily solved by installing numpy in...
Read more >
[Fixed] ModuleNotFoundError: No module named 'numpy'
Summary: The most common cause of ModuleNotFoundError is a faulty installation of the module or importing a module incorrectly. For a successful installation...
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