Python was installed before, and then Anaconda was installed because I was practicing using Python to write scientific calculations. However, after installing Anaconda, another problem occurred. When I wrote Python commands to call numpy on the command line, it could be used normally, but the call in PyCharm would report No module named ‘numpy’, that is, numpy could not be found, as shown below.
Numpy can be used normally on the command line:
However, numpy cannot be used properly in PyCharm:
This problem occurs because the interpreter that Pycharm USES is not the installed Python 3.6, but comes with the Python.exe interpreter, and there are only two modules PIP and SetupTools, so that many third-party libraries cannot be used in Pycharm. Only the Settings on PyCharm (File-> settings-> Project: Current project name -& GT; Set Interpreter in the Project Interpreter. Set it to Anaconda, as shown in the figure below.
Then the program will run normally
The experimental procedure for this example is as follows
Numpy can be used normally on the command line:
However, numpy cannot be used properly in PyCharm:
This problem occurs because the interpreter that Pycharm USES is not the installed Python 3.6, but comes with the Python.exe interpreter, and there are only two modules PIP and SetupTools, so that many third-party libraries cannot be used in Pycharm. Only the Settings on PyCharm (File-> settings-> Project: Current project name -& GT; Set Interpreter in the Project Interpreter. Set it to Anaconda, as shown in the figure below.
Then the program will run normally
The experimental procedure for this example is as follows
from numpy import *
import operator
a = random.rand(4,4)
print(a)
Read More:
- UserWarning: Failed to initialize NumPy: No module named ‘numpy.core._multiarray_umath‘
- No module named numpy error in Python code
- ModuleNotFoundError: No module named ‘numpy.testing.nosetester‘
- Jumper notebook, import numpy, prompt “importerror: DLL load failed: unable to find the specified module”
- AttributeError: module ‘numpy‘ has no attribute ‘getbuffer‘
- Importing the multiarray numpy extension module failed
- ImportError: Importing the multiarray numpy extension module failed.
- vscode import numpy error:DLL load failed: The specific module could not be found
- How to Fix gdb error: Failed to import the site module,No module named ‘_sysconfigdata_m’
- Warning when using numpy: runtimewarning: numpy.dtype size changed, may indicate binary incompatibility
- [solved] runtimeerror: module compiled against API version 0xc but this version of numpy is 0xb
- Module not found error: the solution to the problem of no module named ‘MySQL’
- RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
- Module not founderror: no module named ‘nets.ssd‘
- When VS code imported Cv2, an error ImportError: numpy.core.multiarray failed to import; There are no mistakes in using the Spyder
- Create a new project in pycharm: modulenotfounde rror:No module named ‘distutils.util‘
- Error loading pscopg2 module: no module named pscopg2
- numpy.core._exceptions.MemoryError: Unable to allocate xxx GB
- Error handling method of “no module named ‘stringio’” in Python 3
- Importerror of Django error: no module named**