rickstaa/.ros_conda_wrapper

Doesn't work with ROSRUN

Closed this issue · 2 comments

Describe the bug
The conda wrapper gives an error while trying to use the rosrun command.

To Reproduce
Steps to reproduce the behavior:

  1. Source the .conda_wrapper
  2. Try to run a ros node using rosrun
  3. See error:
catkin build -DPYTHON_EXECUTABLE="$(which python)" -DPYTHON_LIBRARY="$(find $(which python | sed -e 's/\/bin\/python//') -iname libpython*m.s
o)" -DPYTHON_INCLUDE_DIR="$(find $(which python | sed -e 's/\/bin\/python//')/include -iname python*m)"
Traceback (most recent call last):
  File "/usr/bin/catkin", line 11, in <module>
    load_entry_point('catkin-tools==0.4.5', 'console_scripts', 'catkin')()
  File "/opt/conda/envs/autograsp/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/opt/conda/envs/autograsp/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/opt/conda/envs/autograsp/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/opt/conda/envs/autograsp/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/catkin_tools/commands/catkin.py", line 30, in <module>
    from catkin_tools.config import get_verb_aliases
  File "/usr/lib/python2.7/dist-packages/catkin_tools/config.py", line 18, in <module>
    import yaml
  File "/opt/conda/envs/autograsp/lib/python3.7/site-packages/yaml/__init__.py", line 374
    class YAMLObject(metaclass=YAMLObjectMetaclass):
                              ^
SyntaxError: invalid syntax

Expected behavior
The ROS node should start.

Possible solution
Implement additional wrapping around the catkin build command see this command. Making sure it points to a python2 environment. Or the solution given by gvdhoorn

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.97. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Fixed in 4a6b5b6.