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

Does ROS Python library shadow or break other python systems ?

asked 2018-04-02 13:23:46 -0500

elpidiovaldez gravatar image

updated 2018-04-02 13:33:45 -0500

jayess gravatar image

ROS puts /opt/ros/kinetic/lib/python2.7/dist-packages in PYTHONPATH. This is then prepended to the system path when python2 or python3 is used. Is this likely to shadow or break other python packages from Anaconda3 (in python3 or python2 virtual environments) ? I looked in the ROS directory and it all seems very ROS specific, but since I am completely new to python I am not sure.

I have solved my problems with Anaconda3 changing the default version of python to 3.6, so now just concerned with the presence of python2 libraries in the python systempath.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-03 04:22:02 -0500

Akash Purandare gravatar image

updated 2018-04-03 04:23:45 -0500

There are three ways you can approach this.

  1. You can use virtualenv and install anaconda3 inside it, so that there are no conflicts between the different versions of Python.
  2. You can use two different bash files, in which one sources the python of anaconda3, and the other sources the python used for ROS.
  3. You can create symlinks in the Path folder to link anaconda3 python to python3 and ROS python2 to python and also, the Python2 pip to pip and Python3 pip to pip3

I personally prefer the 1st method, as it is the cleanest and easiest. The second is easy to work around. The third one will likely break your system, as it makes the system extremely complex. Can you share what packages you want to install in Anaconda3?

edit flag offensive delete link more

Comments

I use a lot of 'datascience' and AI packages like Tensorflow, numpy, scipy, scilearn, pandas, pillow, opencv.

elpidiovaldez gravatar image elpidiovaldez  ( 2018-05-03 22:52:48 -0500 )edit

As far as I know, if you know how to type Data Science codes in Python 3, you can do so in Python 2 as well. As far as these packages are concerned, the ROS scripts do run on the local environment of python, hence, you will be able to merge all of these to achieve the results. Install them using pip

Akash Purandare gravatar image Akash Purandare  ( 2018-05-04 05:12:40 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-04-02 13:23:46 -0500

Seen: 191 times

Last updated: Apr 03 '18