ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

No module named _multiarray_umath - but I can find it

asked 2019-08-11 15:33:30 -0500

billy gravatar image

updated 2019-08-11 16:29:34 -0500

jayess gravatar image

Having issue with importing a NUMPY module. Have been fighting for hours with it. I have only minor experience with Python.

Summary eror is this:

Original error was: No module named _multiarray_umath

Full error is below.

I am using ROS Lunar on a fresh install of 64bit Ubuntu 16.04. Python 2.7 and 3.5 are installed.

There is a file called _multiarray_umath.cpython-35m-x86_64-linux-gnu.so in the .local/lib/python3.5/site-packages/numpy/core folder.

My PYTHONPATH includes /home/b2/.local/lib/python3.5/site-packages

Full PYTHONPATH

PYTHONPATH = :/home/b2/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/lunar/lib/python2.7/dist-packages::/home/b2/tf/models/research/object_detection:/home/b2/tf/models/research/object_detection/slim:/home/b2/tf/models:/home/b2/tf/models/slim:/home/b2/tf/models:/home/b2/tf/models/slim:/home/b2/tf/models:/home/b2/tf/models/research:/home/b2/tf/models:/home/b2/tf/models/research/object_detection:/home/b2/dodo:/home/b2/.local/lib/python3.5/site-packages

Full error:

process[dodo_detector_ros-1]: started with pid [32515]
Traceback (most recent call last):
  File "/home/b2/catkin_ws/src/dodo_detector_ros/src/detector.py", line 5, in <module>
    import numpy
  File "/home/b2/.local/lib/python3.5/site-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/home/b2/.local/lib/python3.5/site-packages/numpy/core/__init__.py", line 47, 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 Python2.7 from "/usr/bin/python",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.17.0" 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 _multiarray_umath

[dodo_detector_ros-1] process has died [pid 32515, exit code 1, cmd /home/b2/catkin_ws/src/dodo_detector_ros/src/detector.py __name:=dodo_detector_ros __log:=/home/b2/.ros/log/83d1cde4-bc00-11e9-8dfc-100ba9588b18/dodo_detector_ros-1.log].
log file: /home/b2/.ros/log/83d1cde4-bc00-11e9-8dfc-100ba9588b18/dodo_detector_ros-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

I have unistalled and reinstalled numpy using pip3.

Attempting to install using just pip(pip install --upgrade numpy) results in an error saying python 3.5 required.

The user/bin/python folder has links to ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-08-12 04:32:51 -0500

ct2034 gravatar image

updated 2019-08-12 04:33:15 -0500

You seem to have a setup mixed between python2 and 3. Make sure your PYTHONPATH only contains python2 and also make sure to install numpy with pip2.

edit flag offensive delete link more

Comments

Yes. I found the core issue I had was caused by an issue installing tensorflow using the "--upgrade" flag with pip. Using "--upgrade" even in pip (pip2) will include upgrading numpy to 1.17 - which requires python 3.5. Tensorflow actually only needs numpy1.14 which is OK with 2.7..

That error caused me to switch to pip3 which of course installed the 3.5 version of tensorflow. So I had mixed 2.7 and 3.5. I uninstalled tensorflow and re-installed with pip without --upgrade flag and the numpy issue went away.

I am now on to a new issue, but at least no longer fighting the import errors - of which there were many more than just the one I mentioned in my post.

Thanks for your help.

billy gravatar image billy  ( 2019-08-12 12:02:32 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-08-11 15:33:30 -0500

Seen: 4,841 times

Last updated: Aug 12 '19