catkin: Building catkin Workspace fails - install-layout not recognized

Hello, as I tried building ROS in catkin workspace today I got following error after invoking catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

/usr/bin/env PYTHONPATH=/home/ecke/catkin_ws/install_isolated/lib/python3/dist-packages:/home/ecke/catkin_ws/build_isolated/catkin/lib/python3/dist-packages::/usr/local/lib/paraview-4.3/site-packages/:/usr/local/lib/veloview-3.1/site-packages/:/usr/local/lib/paraview-4.3/:/usr/local/lib/paraview-4.3/site-packages/vtk/ CATKIN_BINARY_DIR=/home/ecke/catkin_ws/build_isolated/catkin /home/ecke/miniconda3/bin/python /home/ecke/catkin_ws/src/catkin/setup.py build --build-base /home/ecke/catkin_ws/build_isolated/catkin install –install-layout=deb --prefix=/home/ecke/catkin_ws/install_isolated --install-scripts=/home/ecke/catkin_ws/install_isolated/bin usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …] or: setup.py --help [cmd1 cmd2 …] or: setup.py --help-commands or: setup.py cmd --help

error: option --install-layout not recognized CMake Error at catkin_generated/safe_execute_install.cmake:4 (message):

execute_process(/home/ecke/catkin_ws/build_isolated/catkin/catkin_generated/python_distutils_install.sh) returned error code Call Stack (most recent call first): cmake_install.cmake:149 (include)

Makefile:61: die Regel für Ziel „install“ scheiterteros make: *** [install] Fehler 1 <== Failed to process package ‘catkin’: Command ‘[‘make’, ‘install’]’ returned non-zero exit status 2

Upto this point I followed the ROS-setup-tutorial to make sure I’m not missing out on any step.

Checking dependencies rosdep update && rosdep install --from-paths /home/ecke/catkin_ws/src --ignore-src --os=ubuntu:xenial resolved in #All required rosdeps installed successfully

system-info: uname -a Linux mechlab-GL552JX 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

python --version Python 3.6.0 :: Continuum Analytics, Inc.

which python /home/ecke/miniconda3/bin/python

Might there be an issue with python 3.6 through miniconda being the system default?

Thanks in advance for your help.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Keeping on searching I finally found a work around the --install-layout issue here. Invoking ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_DEB_LAYOUT=OFF did it.

@icolwell-as

Confirmed, 20.04 noetic downgrading setuptools works!

I just ran into this problem on Ubuntu 20.04 using ROS Noetic trying to build Autoware.ai. To summarize on what some others in this thread have suggested, there are 3 options to fix this:

  1. Downgrade your locally-installed setuptools to match the same version of released as part of ubuntu focal:
pip3 install setuptools==45.2.0

Credit for this solution goes to this PR: https://github.com/usdot-fhwa-stol/carma-base/pull/111

  1. Use the -DSETUPTOOLS_DEB_LAYOUT=OFF option and forget about it. If you are using colcon, you can add this to your default file located at ~/.colcon/defaults.yaml. Here’s an example:
{
    "build": {
        "cmake-args": ["-DSETUPTOOLS_DEB_LAYOUT=OFF"]
    }
}

This way you don’t have to specify it on the command line every time.

  1. I also tried the nuclear option and deleted ~/.local/lib/python3.8 which reverted to using the system-install python and resolved the issue. If you are nervous about deleting your local python install, the PYTHONUSERBASE env variable might work for you to switch to the system-installed python.

I tested all 3 of these options and they all seem to resolve the issue. Option 1 seems like the cleanest solution.

EDIT: Added another option to resolve the issue.

Setting the catkin CMake flag SETUPTOOLS_DEB_LAYOUT is certainly a temporary workaround. But it would be important to figure out why setuptools doesn’t have that option. If you can troubleshoot this further and identify why your system is different that would likely help us to make it work for other users out of the box.

FYI: --install-layout is a debian modification to Pythons “distutils” module. That option is maintained by and only shipped with Debian(-derivates), it is not part of the official Python release. So anyone using other python releases cannot use --install-layout.

For people who use catkin tools (like catkin build) and choose to go with option 1 that @icolwell-as wrote above, add the CMake flag before running catkin_build like this:

  1. catkin config --cmake-args -DSETUPTOOLS_DEB_LAYOUT=OFF
  2. catkin_build