numpy: cannot import name '_distributor_init'

  There are not many solutions to this problem online, and I have not found an effective way to deal with it.
  Of course, when the error is reported, it has already given a solution, it has been given! ! ! Be sure to remember to look carefully, I was a flask project on the server at the time, and the error message was in apache's error.log, which gave a very detailed explanation and solution, but I only read the last line... embarrassing.

 Try uninstalling and reinstalling numpy.
…… - If you have already done that, then:
……   1. Check that you expected to use Python3.4 from "/var/www/flask_demo/venv/bin/python3",
…… and that you have no directories in your PATH or PYTHONPATH that can
…… interfere with the Python and numpy version "1.17.2" you're trying to use.
…… 2. If (1) looks fine, you can open a new issue at
…… https://github.com/numpy/numpy/issues.  Please include details on:
…… - how you installed Python
…… - how you installed numpy
…… - your operating system
…… - whether or not you have multiple versions of Python installed
…… - if you built from source, your compiler versions and ideally a build log
…… - If you're working with a numpy git repository, try `git clean -xdf`
…… (removes all files not under version control) and rebuild numpy.

  Coincidentally, my problem happened to be the first one. The dependency package used in the project is Python 3.7.4 version, but the result is that the python running is 3.4, so an error is reported. Uninstalling Python 3.4 and reinstalling Python 3.7 solved it. Of course, you can also use numpy adapted to Python 3.4, which should also solve the problem. However, the other dependent packages on my side also use Python3.7, so I just reinstall Python.

Reference article: [1] python - ImportError: cannot import name _distributor_init - Stack Overflow
     [2] python - ImportError: cannot import name NUMPY_MKL - Stack Overflow
     [3] python - Numpy - ImportError: cannot import name _distributor_init - Stack Overflow
     [4] Problems importing Scipy submodules in Python? - Know almost

Published 195 original articles , received 139 likes , and visited 120,000+