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

CMakeLists.txt: Install Python

asked 2014-07-20 12:56:44 -0500

David Lu gravatar image

What is the best way to install python libraries with a package?

This tutorial says how to do Python scripts, and I know you also need a setup.py, but I'm having trouble running import easy_markers with the deb package generated from easy_markers

(and now that I checked, I apparently can't run either of my scripts in the package either using rosrun)

You can download and test this package with apt-get install ros-groovy-easy-markers

edit retag flag offensive close merge delete

Comments

Does the `import easy_markers` work now?

demmeln gravatar image demmeln  ( 2014-07-22 19:23:54 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2014-07-22 17:53:00 -0500

joq gravatar image

For Python 3 migration reasons, the recommended install method has changed from install(PROGRAMS ...) to catkin_install_python(PROGRAMS ...).

See the how-to page for installing Python scripts and modules.

edit flag offensive delete link more

Comments

Then it is unfortunate that the tutorial on the wiki is out of data: http://wiki.ros.org/catkin/CMakeLists.txt#Installing_Python_Executable_Scripts

demmeln gravatar image demmeln  ( 2014-07-22 19:23:17 -0500 )edit

Yeah. It's hard to find and fix all the stuff on the wiki. If I still remember about this problem, I'll fix it when I get back from vacation. Please open an issue for catkin, so it does not get lost.

joq gravatar image joq  ( 2014-07-23 08:45:11 -0500 )edit

I will open an issue. Keep enjoying (hopefully) your vacation and not worrying about caktin :-).

demmeln gravatar image demmeln  ( 2014-07-23 09:10:50 -0500 )edit
2

http://wiki.ros.org/catkin/CMakeLists.txt#Installing_Python_Executable_Scripts fixed in the wiki now.

joq gravatar image joq  ( 2014-07-30 13:47:56 -0500 )edit

Thanks joq

David Lu gravatar image David Lu  ( 2014-07-30 15:51:46 -0500 )edit
2

answered 2014-07-20 15:22:56 -0500

ahendrix gravatar image

From looking at your package, the first thing I notice is that the released version is 0.1.0, and the version in the repository is 0.1.1. Did you forget to do a release of the latest version?

Looking at the source repository, there's only one thing that stands out:

For installing python scripts, the most reliable method is to use CMake's install(PROGRAMS ...) because it automatically sets the executable bit on your programs. Without it, your scripts will be installed, but they won't always be executable, so rosrun won't be able to find them.

edit flag offensive delete link more

Comments

it should be noted that @joq 's answer should be preferred

demmeln gravatar image demmeln  ( 2014-07-30 15:33:29 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-20 12:56:44 -0500

Seen: 1,976 times

Last updated: Jul 22 '14