Ask Your Question
2

Catkin fails on osx 10.9, can't find '__main__' module in empy-3.1-py2.7.egg/em.pyc

asked 2013-11-13 03:22:01 -0600

Bruno Normande gravatar image

updated 2013-11-13 14:48:48 -0600

After a lot of trouble to install build everything with rosdep and brew, I got this error when trying to run: ./src/catkin/bin/catkin_make_isolated --install

-- Using CATKIN_DEVEL_PREFIX: /Users/bruno/ros_catkin_ws/devel_isolated/catkin
-- Using CMAKE_PREFIX_PATH: 
-- Using default Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /Users/bruno/ros_catkin_ws/build_isolated/catkin/test_results
-- Found gtest: gtests will be built
-- catkin 0.5.77
/usr/bin/python: can't find '__main__' module in '/Library/Python/2.7/site-packages/empy-3.1-py2.7.egg/em.pyc'
CMake Error at cmake/safe_execute_process.cmake:11 (message):

  execute_process(/Users/bruno/ros_catkin_ws/build_isolated/catkin/catkin_generated/env_cached.sh
  "/usr/bin/python"
  "/Library/Python/2.7/site-packages/empy-3.1-py2.7.egg/em.pyc"
  "--raw-errors" "-F"
  "/Users/bruno/ros_catkin_ws/build_isolated/catkin/catkin_generated/pkg.develspace.context.pc.py"
  "-o"
  "/Users/bruno/ros_catkin_ws/devel_isolated/catkin/lib/pkgconfig/catkin.pc"
  "/Users/bruno/ros_catkin_ws/src/catkin/cmake/em/pkg.pc.em") returned error
  code 1
Call Stack (most recent call first):
  cmake/em_expand.cmake:23 (safe_execute_process)
  cmake/catkin_package.cmake:358 (em_expand)
  cmake/catkin_package.cmake:98 (_catkin_package)
  CMakeLists.txt:11 (catkin_package)


-- Configuring incomplete, errors occurred!
See also "/Users/bruno/ros_catkin_ws/build_isolated/catkin/CMakeFiles/CMakeOutput.log".

ls -l /usr/local//lib/python2.7/site-packages/

drwxr-xr-x    7 bruno  admin     238 23 Out 09:13 GDAL-1.10.1-py2.7.egg-info
drwxr-xr-x   26 bruno  admin     884 13 Nov 11:26 PyQt4
drwxr-xr-x   21 bruno  admin     714 13 Nov 01:31 PySide
drwxr-xr-x    7 bruno  admin     238 10 Nov 09:20 VTK-5.10.1-py2.7.egg-info
lrwxr-xr-x    1 bruno  admin      64  5 Nov 00:22 cv.py -> ../../../Cellar/opencv/2.4.6.1/lib/python2.7/site-packages/cv.py
lrwxr-xr-x    1 bruno  admin      65  5 Nov 00:22 cv2.so -> ../../../Cellar/opencv/2.4.6.1/lib/python2.7/site-packages/cv2.so
-rw-r--r--    1 bruno  admin     236 13 Nov 22:14 easy-install.pth
-rw-r--r--    1 root   admin  114277 27 Out  2003 em.py
-rw-r--r--    1 root   admin  131548 13 Nov 22:37 em.pyc
-rw-r--r--    1 root   admin    1165 13 Nov 22:37 empy-3.1-py2.7.egg-info
lrwxr-xr-x    1 bruno  admin      63 23 Out 09:13 gdal.py -> ../../../Cellar/gdal/1.10.1/lib/python2.7/site-packages/gdal.py
lrwxr-xr-x    1 bruno  admin      68 23 Out 09:13 gdalconst.py -> ../../../Cellar/gdal/1.10.1/lib/python2.7/site-packages/gdalconst.py
lrwxr-xr-x    1 bruno  admin      70 23 Out 09:13 gdalnumeric.py -> ../../../Cellar/gdal/1.10.1/lib/python2.7/site-packages/gdalnumeric.py
drwxr-xr-x    5 bruno  admin     170 10 Nov 21:09 git_remote_helpers
lrwxr-xr-x    1 bruno  admin      95 10 Nov 21:09 git_remote_helpers-0.1.0-py2.7.egg-info -> ../../../Cellar/git/1.8.4.3/lib/python2.7/site-packages/git_remote_helpers-0.1.0-py2.7.egg-info
drwxr-xr-x   40 bruno  admin    1360 12 Nov 22:03 hgext
drwxr-xr-x  105 bruno  admin    3570 12 Nov 22:03 mercurial
lrwxr-xr-x    1 bruno  admin      86 12 Nov 22:03 mercurial-2.8-py2.7.egg-info -> ../../../Cellar/mercurial/2.8/lib/python2.7/site-packages/mercurial-2.8-py2.7.egg-info
lrwxr-xr-x    1 bruno  admin      62 23 Out 09:13 ogr.py -> ../../../Cellar/gdal ...
(more)
edit retag flag offensive close merge delete

Comments

Are you on OSX 10.8? What package is this?

Artem gravatar image Artem  ( 2013-11-13 05:22:31 -0600 )edit

OSX 10.9, and I'm not installing catkin with brew, but with the command ./src/catkin/bin/catkin_make_isolated --install. I followed all steps in http://wiki.ros.org/hydro/Installation/OSX/Homebrew/Source

Bruno Normande gravatar image Bruno Normande  ( 2013-11-13 07:55:24 -0600 )edit

Hmm looks like some python dependencies problem. Try to do this command again and carefully check that there were no errors. sudo pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pig Distribute

Artem gravatar image Artem  ( 2013-11-13 08:16:14 -0600 )edit

Everything reinstalled, without errors, but still same problem (I'm assuming you miss-typed catkin-pkg). It says that can't find __main__ in empty, but i just tested the package and seems all right... :(

Bruno Normande gravatar image Bruno Normande  ( 2013-11-13 08:50:52 -0600 )edit

What does `which python` say?

Artem gravatar image Artem  ( 2013-11-13 09:06:50 -0600 )edit

Make sure that you are using python 2.7.5 that you installed with homebrew and not the system python.

Artem gravatar image Artem  ( 2013-11-13 09:19:23 -0600 )edit

Can you execute `ls -l /usr/local//lib/python2.7/site-packages/`

Artem gravatar image Artem  ( 2013-11-13 09:22:15 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-11-13 20:53:38 -0600

jensenb gravatar image

I got this exact same error after installing empy using easy_install (because installation through rosdep using pip failed). For me the only way to solve the problem was to remove the installed version:

sudo pip uninstall empy

and then to download the package directly from the author: http://www.alcyone.com/software/empy/empy-latest.tar.gz, followed by installing the package by hand:

tar xzf empy-latest.tar.gz
cd empy-3.3
sudo python setup.py install

These steps got rid of the empy errors for me.

edit flag offensive delete link more

Comments

Thanks, that worked! (although I had already tried, and for some reason it didn't work before).

Bruno Normande gravatar image Bruno Normande  ( 2013-11-14 00:16:24 -0600 )edit
-1

answered 2020-11-17 06:29:40 -0600

htanwar922 gravatar image

updated 2020-12-07 15:10:58 -0600

Dear reader,
In Ubuntu 20.04 with ROS Noetic it showed

em: error: couldn't find "__main__" module in /usr/local/lib/python3.8/dist-packages/em.

I tried renaming __init__.py in that location to __main__.py, and other answers, none worked.

The only workaround that successfully worked was:
Copy the file named em.py in the /usr/local/lib/python3.8/dist-packages directory and paste in the above em directory with name __main__.py

sudo cp -T /usr/local/lib/python3.8/dist-packages/em.py /usr/local/lib/python3.8/dist-packages/em/__main__.py

I've uploaded my em directory for reference here: /usr/local/lib/python3.8/dist-packages/em

Note: Your em module may be installed somewhere else, in which case find the directory from the catkin_make error or run python3 -m pip show em or accordingly.

-Himanshu

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-11-13 03:22:01 -0600

Seen: 2,035 times

Last updated: Dec 07 '20