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

Revision history [back]

click to hide/show revision 1
initial version

I have a mixed C++/Python package. To install Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
  • Add an empty __init__.py file in my_package/scripts
  • Make each of the Python files executable with chmod +x
  • Add this to CMakeLists:

install(PROGRAMS
scripts/my_python_file.py
DESTINATION lib/${PROJECT_NAME} )

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something.

I have a mixed C++/Python package. To install a Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
  • Add an empty __init__.py file in my_package/scripts
  • Make each of the Python files it executable with chmod +x
  • Add an empty __init__.py file in my_package/scripts
  • Add this to CMakeLists:

install(PROGRAMS
scripts/my_python_file.py
DESTINATION lib/${PROJECT_NAME} )

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something.something. Perhaps it's not Windows-compatible or something like that.

I have a mixed C++/Python package. To install a Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
  • Make it executable with chmod +x
  • Add an empty __init__.py file in my_package/scripts
  • Add this to CMakeLists:

install(PROGRAMS
scripts/my_python_file.py
DESTINATION lib/${PROJECT_NAME} )

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something. Perhaps it's not Windows-compatible or something like that.

I have a mixed C++/Python package. To install a Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
  • Make it executable with chmod +x
  • Add an empty __init__.py file in my_package/scripts
  • Add this to CMakeLists:

install(PROGRAMS
scripts/my_python_file.py
DESTINATION lib/${PROJECT_NAME} )

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something. Perhaps it's not Windows-compatible or something like that.

I have a mixed C++/Python package. To install a Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
  • Make it executable with chmod +x
  • Add an empty __init__.py file in my_package/scripts
  • Add this to CMakeLists:

install(PROGRAMS 
scripts/my_python_file.py
DESTINATION lib/${PROJECT_NAME} )

)

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something. Perhaps it's not Windows-compatible or something like that.

I have a mixed C++/Python package. To install a Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
    • Add this line at the top of ^that file: #!/usr/bin/env python3
  • Make it executable with chmod +x
  • Add an empty __init__.py file in my_package/scripts
  • Add this to CMakeLists:
install(PROGRAMS  
  scripts/my_python_file.py  
  DESTINATION lib/${PROJECT_NAME} )

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something. Perhaps it's not Windows-compatible or something like that.

I have a mixed C++/Python package. To install a Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
    • Add this line at the top of ^that file: #!/usr/bin/env python3
  • Make it executable with chmod +x
  • Add an empty __init__.py file in my_package/scripts
  • Add this to CMakeLists:
install(PROGRAMS  
  scripts/my_python_file.py  
  DESTINATION lib/${PROJECT_NAME} )

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something. Perhaps it's not Windows-compatible or something like that.

I have a mixed C++/Python package. To install a Python executable in this package, I've found it sufficient to do this:

  • Add the Python source file to my_package/scripts
  • Add this line at the top of ^that file: #!/usr/bin/env python3
  • Make it executable with chmod +x
  • Add an empty __init__.py file in my_package/scripts
  • Add this to CMakeLists:
install(PROGRAMS  
  scripts/my_python_file.py  
  DESTINATION lib/${PROJECT_NAME} )

To me, this seems a lot easier than what the tutorial recommends with setup.cfg and setup.py but maybe I'm missing something. Perhaps it's not Windows-compatible or something like that.