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

How do i run PYTHON3 scripts from a launch file ?

asked 2019-12-19 23:33:06 -0500

Hi ,

I have a working Ros-ified deeplearning code which happens to be in Python3 .

The script works fine when i do

python3 my_script.py

I am not finding any information on how to include this in a launch file .

I am aware of

rosrun package_name python_script.py

Can i set some argument for the python path while running the above command ?

edit retag flag offensive close merge delete

Comments

same issue

gurselturkeri gravatar image gurselturkeri  ( 2022-07-06 07:37:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
-1

answered 2019-12-19 23:47:48 -0500

Abhishekpg gravatar image

You can set your python path in your environment.

Try echo $PYTHONPATH

Then add below line to ur .bashrc file

export PYTHONPATH="path to your python3"

Hope this is what you are looking for

edit flag offensive delete link more

Comments

1

Changing your $PYTHONPATH is not going to change the default Python interpreter. It only changes the locations which the interpreter will search for Python modules.

I don't believe what you are suggesting will work.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-20 03:48:19 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-19 23:33:06 -0500

Seen: 1,113 times

Last updated: Jul 06 '22