Robotics StackExchange | Archived questions

Python inconsistency between deb and install space

I was having a problem with install space for rosh where it couldn't import anything from rosh.impl, so following rospy's example, I updated the setup.py to look like packages=['rosh', 'rosh.impl']. This fixed the install space issue, but now when running from the debs, rosh.impl can't be imported anymore. What's the correct configuration that will work in install space and debs?

For reference, package.xml, CMakeLists.txt, setup.py.

Edit 2: I thought I had done a release since adding rosh.impl to packages, but apparently I had not. That is almost certainly where the inconsistency is coming from.

Edit: In both non-working cases, rosh.impl can't be imported because impl doesn't exist in dist-packages/rosh.

Traceback:

import rosh.plugin
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-7e3593b021bb> in <module>()
----> 1 import rosh.plugin

/opt/ros/hydro/lib/python2.7/dist-packages/rosh/__init__.py in <module>()
     57 latching = True
     58 
---> 59 import rosh.plugin
     60 import rosh.impl.ros_packages
     61 import rosh.impl.ros_graph

/opt/ros/hydro/lib/python2.7/dist-packages/rosh/plugin.py in <module>()
     35 import roslib
     36 import roslib.packages
---> 37 from rosh.impl.exceptions import ROSHException, InvalidPlugin, NoPlugin
     38 
     39 # TODO: possibly store other data in here, like plugin help, etc...

ImportError: No module named impl.exceptions

Getting rid of the requires=... doesn't seem to have any effect for install space. Both catkin_make install and running python setup.py build manually doesn't even issue a warning/error either way.

Asked by Dan Lazewatsky on 2014-07-25 12:44:03 UTC

Comments

Answers

Why does it not import in deb, does it not exist or does it not import because its dependencies are missing?

I would think this line is wrong in your setup.py:

https://github.com/OSUrobotics/rosh_core/blob/hydro-devel/rosh/setup.py#L10

The requires field is not used in debian packaging because we capture the dependencies with package.xml and convert those into debian dependencies. And in fact rospy and std_msgs cannot be installed with pip, so I don't think that makes sense.

I found some documentation which seemed to suggest this was an option you should provide, but I believe this is wrong, so I updated it:

http://wiki.ros.org/rospy_tutorials/Tutorials/Makefile

I'm not sure if this is the root of your issue, but I would remove the requires=... line from your setup.py.

It would be helpful if you could give more details, by editing your original question, about why it cannot be imported from the debian, like a traceback.

Asked by William on 2014-07-25 13:14:20 UTC

Comments