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

How can work with ros inside a python 3 conda env

asked 2019-02-09 07:42:07 -0500

mohamedaminhuidi gravatar image

I am working on a mobile robot that can detect and track people. for the detection and tracking, i want to use my own models and write a ros node that will publish the coordinates of the person you want to follow to the action server. i have ros kinetic installed,and i installed anaconda and made a conda env with all the deep learning libraries i need.however i am wondering how can i work with ros inside my conda env in which python 3 is the default language. ps:i have seen that you can modify your bash rc to work with either of them,but you cant work with both at the same time (with ros while inside my conda env) ps: the solution at https://github.com/udacity/RoboND-Pyt... made me unable to work with ros at all.and conda still worked even when i didnt do the unset pythonpath. ps: i cant install kinetic for python 3 because i need to use other packages in the navigation stack.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2019-02-25 03:22:22 -0500

mohamedaminhuidi gravatar image

got my answer.you can't use conda and ros together. i think there is a way that can get you to use ros in a conda environment,but then you won't be able to use it outside of that env. basically its not worth the effort. just install whatever deep learrning library you want without conda, and specifiy in the shebang of your ros node what version of python you are using(python or python3).

edit flag offensive delete link more

Comments

2

I created a small wrapper that might ease the process of using ROS inside a Conda environment. It can be found here.

rickstaa gravatar image rickstaa  ( 2019-11-08 10:36:03 -0500 )edit

well that's awesome, its an amazing application. thank you sir.

mohamedaminhuidi gravatar image mohamedaminhuidi  ( 2019-11-08 13:58:56 -0500 )edit
1

answered 2021-02-18 10:22:07 -0500

Silvio Traversaro gravatar image

updated 2021-02-19 09:37:24 -0500

Hi! I found this answer from a Google search, just for your information in 2021 installing ROS directly in conda (without using apt-installed ROS at all, so removing any risk of incompatibility) should be much straightforward.

In particular you can simply install ROS Noetic packages in a conda environment with the following command:

conda install -c conda-forge -c robostack ros-noetic-desktop

See the following links for more details:

edit flag offensive delete link more

Comments

Instead of posting a link to a blog post could you please update your answer with a summary of it or the relevant information from it?

jayess gravatar image jayess  ( 2021-02-18 16:37:42 -0500 )edit
1

Done, feel free if you think the answer can be further improved.

Silvio Traversaro gravatar image Silvio Traversaro  ( 2021-02-19 09:37:39 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-02-09 07:42:07 -0500

Seen: 9,991 times

Last updated: Feb 19 '21