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

procedure to get catkin_make install generate and copy only pyc and no .py

asked 2014-09-18 16:46:53 -0600

Damien gravatar image

Hi. I need to ship to some client ans application based on ROS. I don't want to provide my source code to this client. So I'm planning to ship a tar.gz of the /install folder of catkin_ws or a .deb.

One starting question: does a .pyc file dependent on my system settings? or will my client have the capability to execute my node since he uses the same version of ubuntu and ros?

Supposing it makes sense to ship a .pyc and not a .py file:

The package packing process will take as input the /install folder. The files that end-up in /install are set in the CMakeList.txt So if I want to ship on .pyc files, I should specify them explicitly in the install section of CmakeList


  • If I checkout my svn repo in a clean environment, run catkin_make, I get an error since no pyc files have been generated yet and my Camkefile is inconsistent.

  • This works fine if in Cmakefile I specify to install but this is not what I want...

So is there a way to force catkin_make to build all the python in .pyc?

Otherwise I need to run this twice with a change in Cmakelist in between... I have lots of proprietary packages to ship, and this is just not OK.

Thanks for any insights


edit retag flag offensive close merge delete


Hi Damein,

Are you able to run your rospy node with this process? I am trying to do the same process for both C++ and python packages. However, it takes a lot of efforts to run a ros from install directory. Let me know if you have some simple way of doing this?

Jarvis gravatar image Jarvis  ( 2014-09-19 21:46:22 -0600 )edit

You can check my post at link text

Jarvis gravatar image Jarvis  ( 2014-09-19 21:46:47 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-19 17:33:05 -0600

ahendrix gravatar image

catkin doesn't have any functionality for this.

I'm not even sure compiled python bytecode (.pyc) will run without the original source code.

This stack overflow question has a reasonable overview of the ways to obfuscate and package your python source code.

edit flag offensive delete link more


The bytecode will run without the source code

LSD gravatar image LSD  ( 2021-01-12 12:56:49 -0600 )edit

Question Tools



Asked: 2014-09-18 16:46:53 -0600

Seen: 2,317 times

Last updated: Sep 19 '14