Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

getting up to speed on Anaconda, I keep receiving an error message when I try to import 'numpy' into Python. Here is what I have done so far:

  • Downloaded anaconda from anaconda.com (64-Bit Graphical Installer (466 MB) with Python 3.7 for Windows);
  • Installed anaconda (under C:\Users\'Username'\Anaconda3 | Option 'Register Anaconda3 as my default Python 3.7')
  • Now I'm trying to import numpy into Python using idle.exe, which produces following error message:

     Warning: os.path.expanduser("~") points to
     but the path does not exist.
    

    Futhermore, after executing "'import 'numpy;" in IDLE I get the following error message. Unfortunately none of the advice was helpful. Numpy seems to be properly installed.

    Warning (from warnings module):  File "C:\Users\'Username'\Anaconda3\lib\site-   
    packages\numpy\__init__.py", line 140
    from . import _distributor_init
    UserWarning: mkl-service package failed to import, therefore Intel(R) MKL    
    initialization ensuring its correct out-of-the box operation under condition 
    when Gnu OpenMP had already been loaded by Python process is not assured. 
    Please install mkl-service package, see http://github.com/IntelPython/mkl-
    service
    Traceback (most recent call last):
    File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\__init__.py",   
    line 24, in <module>
    from . import multiarray
    File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\multiarray.py",   
    line 14, in <module>
    from . import overrides
    File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\overrides.py", 
    line 7, in <module>
    from numpy.core._multiarray_umath import (
    ImportError: DLL load failed: The specified module could not be found.
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
    File "C:\Users\'Username'\Anaconda3\Scripts\myscripts\import_test.py", line 1,   
    in <module>
    import numpy
    File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\__init__.py", line   
    142, in <module>
    from . import core
    File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\__init__.py", 
    line 54, in <module>
    raise ImportError(msg)
    ImportError: 
    IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
    Importing the numpy c-extensions failed.
    - Try uninstalling and reinstalling numpy.
    - If you have already done that, then:
    1. Check that you expected to use Python3.7 from   
    "C:\Users\'Username'\Anaconda3\python.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.1" 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.
    Note: this error has many possible causes, so please don't comment on
    an existing issue about this - open a new one instead.
    Original error was: DLL load failed: The specified module could not be found.
    

    Many thanks in advance for any help and suggestions.

    The option 'Register Anaconda3 as my default Python 3.7' is not recommended and a contradiction to the whole conda concept. This is begging for trouble ... – Peter May 13, 2020 at 19:42 Thanks, Peter. I'm new to Anaconda and followed the instructions from the anaconda website, where this option is recommended. Will try to reinstall and chose the other option instead. – Nicolas83 May 13, 2020 at 19:53

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.