numpy is already installed with Anaconda but I get an ImportError (DLL load failed: The specified module could not be found)

后端 未结 5 901
鱼传尺愫
鱼传尺愫 2020-11-30 04:03

I am using the Anaconda distribution with Python 3.7. Among the packages installed, I have numpy, pandas, etc. In PyCharm IDE, I have set the Project Interpreter to be the p

5条回答
  •  萌比男神i
    2020-11-30 04:45

    Even I was running the python file on command prompt, but the python.exe was from Anaconda. so when you run any python file you get,

    Warning: This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environment please see https://conda.io/activation.

    you need to activate the environment by using this command

     conda init cmd.exe
     conda activate 
    

    you see the command window as below, with base env

    (base) C:\Users\yash\Documents\pycharm_project\venv>
    

    Doing this I resolved this error

    ImportError: numpy.core.multiarray failed to import Traceback (most recent call last): File "opencv_p1.py", line 2, in import cv2 File "E:\Anaconda3\lib\site-packages\cv2__init__.py", line 3, in from .cv2 import * ImportError: numpy.core.multiarray failed to import

    In case you want to deactivate the conda use

     conda deactivate
    

    Please follow this link in case you have any doubt https://conda.io/activation

提交回复
热议问题