Score:0

Import issue on ipython environment: `No module named 'numpy.core._multiarray_umath'`

in flag

Steps to reproduce:

I hope someone may read this (verbose) issue.

I (try to) develop the library pybary with NumPy and scipy (you may give your impressions). Well, very promising! Along the development process, I stumbled on an error log in the section "Error message" by the following workflow:

  1. Open a new terminal;
  2. Clone the repository locally;
  3. Run the command make install: it runs poetry shell && poetry install, which activates the local environment;
  4. Open ipython instance by command run ipython;
  5. Try to import either "numpy" or "scipy" respectively with import numpy or import scipy statements.

Error message:

---------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File /usr/lib/python3/dist-packages/numpy/core/__init__.py:17
     16 try:
---> 17     from . import multiarray
     18 except ImportError as exc:

File /usr/lib/python3/dist-packages/numpy/core/multiarray.py:14
     12 import sys
---> 14 from . import overrides
     15 from . import _multiarray_umath

File /usr/lib/python3/dist-packages/numpy/core/overrides.py:7
      5 import textwrap
----> 7 from numpy.core._multiarray_umath import (
      8     add_docstring, implement_array_function, _get_implementing_args)
      9 from numpy.compat._inspect import getargspec

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 import numpy

File /usr/lib/python3/dist-packages/numpy/__init__.py:142
    139 # Allow distributors to run custom init code
    140 from . import _distributor_init
--> 142 from . import core
    143 from .core import *
    144 from . import compat

File /usr/lib/python3/dist-packages/numpy/core/__init__.py:47
     19     import sys
     20     msg = """
     21 
     22 IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
   (...)
     45 """ % (sys.version_info[0], sys.version_info[1], sys.executable,
     46         __version__, exc)
---> 47     raise ImportError(msg)
     48 finally:
     49     for envkey in env_added:

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.9 from "/bin/python3.9",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.17.4" 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: No module named 'numpy.core._multiarray_umath'

Additional information:

I understand the module multiarray_umath cannot be imported from module numpy.core. I ran a list command on directory /usr/lib/python3/dist-packages/numpy/core which gives the output log below:

_add_newdocs.py                        fromnumeric.py         _methods.py                                         setup_common.py
_aliased_types.py                      function_base.py       multiarray.py                                       setup.py
arrayprint.py                          generate_numpy_api.py  _multiarray_tests.cpython-38-x86_64-linux-gnu.so    shape_base.py
_asarray.py                            getlimits.py           _multiarray_umath.cpython-38-x86_64-linux-gnu.so    _string_helpers.py
cversions.py                           include                numeric.py                                          _struct_ufunc_tests.cpython-38-x86_64-linux-gnu.so
defchararray.py                        info.py                numerictypes.py                                     tests
_dtype_ctypes.py                       __init__.py            _operand_flag_tests.cpython-38-x86_64-linux-gnu.so  _type_aliases.py
_dtype.py                              _internal.py           overrides.py                                        _ufunc_config.py
_dummy.cpython-38-x86_64-linux-gnu.so  lib                    __pycache__                                         umath.py
einsumfunc.py                          machar.py              _rational_tests.cpython-38-x86_64-linux-gnu.so      _umath_tests.cpython-38-x86_64-linux-gnu.so
_exceptions.py                         memmap.py              records.py

As we can see, there IS a file multiarray_umath, although its cython extension with further dot-properties makes me skeptical about its utility. This is how far I have to report.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.