The following error occurs when programming in VsCode and using anaconda’s virtual environment as the interpreter to import Cv2
ImportError: numpy.core.multiarray failed to import
After checking the trial, it was found that:
- I use on spyder without this error; Also used after trying to update numPY; And the python interpreter in the lower left corner is the right choice;
It turned out that the reason might be that vs Code was not started correctly and the Anaconda environment might not have been activated.
In the Anaconda Prompt, the following is executed in sequence
conda activate env_name
cd workDir
code .
So now it’s activated and the import is correct.
In addition, try to directly open VS Code, and then open python working directory in the File-Open folder.
Also note this error. The environment of Vscode is correct, but the terminal does not activate the environment. This can be determined by checking the contents of the prefix brackets.
Read More:
- ImportError: numpy.core.multiarray failed to import
- Python_ Part 2 programming problems (3)_ solve numpy.core.multiarray Failed to import problem
- UserWarning: Failed to initialize NumPy: No module named ‘numpy.core._multiarray_umath‘
- ImportError: Importing the multiarray numpy extension module failed.
- How to solve “import cv2 failed ImportError: DLL load fail: Cannot find the specified module” in Anaconda environment
- Jumper notebook, import numpy, prompt “importerror: DLL load failed: unable to find the specified module”
- Importing the multiarray numpy extension module failed
- numpy.core.umath How to solve the problem of failed to import
- Unable to call numpy in pychar, module notfounderror: no module named ‘numpy’
- vscode import numpy error:DLL load failed: The specific module could not be found
- No module named numpy error in Python code
- Importerror: the perfect solution of no module named CV2!!! (not too good)
- cannot import name ‘multiarray’
- [error reported] [Python] [Matplotlib] importerror: failed to import any QT binding
- Scrapy runs a crawler with an error importerror: cannot import name suppress
- numpy.core._exceptions.MemoryError: Unable to allocate xxx GB
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)
- Vs code solves the problem that latex does not display references and [?] is displayed in the text
- cannot import name ‘_validate_lengths’ from ‘numpy.lib.arraypad’
- Ploblematic frame:# C [SrjdDll64.dll+0x314bc]## No core dump will be written. Minidumps are not