Windows10 rosrun couldn't find python scripts in path scripts.
I have run setup.bat
Such I have a package in root path named "test_pkg", and my python scripts in path test_pkg\scripts\talker.py
If I run rosrun test_pkg talker.py
in cmd, I will got error "Couldn't find executable named talker.py"
Buf if I run rosrun test_pkg scripts\talker.py
, it will work well.
It's a little inconvenient, could anyone tell me how to fix it? Thanks.
Have you installed your Python script in your CMakeLists.txt file (search for catkin_install_python())? http://docs.ros.org/melodic/api/catki...
@Sean Yen Can you give me some examples? I tried to add catkin_install_python(PROGRAMS test_pkg scripts/talker.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) in my CMakeLists.txt in path "test_pkg\". But I got error. I think I write it with wrong format. So. could you give some examples? Thanks a lot!.
Can you share the error message you see? Most likely I would guess you should change the line to
catkin_install_python(PROGRAMS scripts/talker.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
and then runcatkin_make
again.@Sean Yen catkin_python_setup() called with unused arguments: PROGRAMS;scripts/talker.py;DESTINATION
My computer couldn't connent network, so I just type the main error message of the log, if you want to the whole log, I can take pictures for you. I'm sorry about that.
@张庆昊 I am also new to ROS but outgoing from the error message i would suggest that you add the python scripts to catkin_install_python(...) and not to catkin_python_setup() in CMakeList.txt so it looks like this:
Afterwards you should try to build it again with catkin_make.
@mab0189 Thanks, but I have left my last company, and start a new career. For all that, still thanks for you.