Ask Your Question
0

How do i run PYTHON3 scripts from a launch file ?

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

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

1 Answer

Sort by ยป oldest newest most voted
0

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

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

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 imagegvdhoorn ( 2019-12-20 03:48:19 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 31 times

Last updated: Dec 19 '19