Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building catkin Workspace fails - install-layout not recognized #863

Closed
Grillen80 opened this issue Mar 29, 2017 · 17 comments
Closed

Building catkin Workspace fails - install-layout not recognized #863

Grillen80 opened this issue Mar 29, 2017 · 17 comments

Comments

@Grillen80
Copy link

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.

@dirk-thomas
Copy link
Member

I just tried building a workspace on Xenial with Pytohn 3.6 from this PPA and it passed successfully.

In general ROS doesn't use / support Conda. So it maybe related to using it. Have you tried it with the standard Python interpreter?

Also you might want to check your setuptools version and post it here. It could be that it is too old or also too new (and the option --install-layout was removed?). I am using version 20.7.0.

@Grillen80
Copy link
Author

Thanks for the quick reply.
Tried it again with the system python (which is 2.7) by removing the miniconda-path from the system's $PATH - got the same error though.

Using python3.6 again pip install setuptools resolves in
Requirement already satisfied: setuptools in ./miniconda3/lib/python3.6/site-packages/setuptools-27.2.0-py3.6.egg
According to pypi latest setuptools version is 34.3.3.
Don't really get it, what it is about the --install-layout-option.

Will try building the workspace with the suggested PPA next.

@Grillen80
Copy link
Author

So I installed Python3.6 from your suggested PPA and set it as system default.
Also cleaned-out the catkin_ws directory and started with downloading ROS into catkin Workspace again.
When calling
rosdep install --from-paths src --ignore-src --rosdistro kinetic -y --os=ubuntu:xenial again I get a positive
#All required rosdeps installed successfully

Then invoking ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
and as before installing fails outputting same (above mentioned) error.

Is it worth mentioning that building process works fine? Meaning installation itself fails.

@Grillen80
Copy link
Author

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.

@dirk-thomas
Copy link
Member

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.

@hayoung-kim
Copy link

hayoung-kim commented Aug 3, 2017

@Grillen80 Thank you. It makes me feel very happy. it's really helpful. it works!

@dirk-thomas
Copy link
Member

Closing due to lack of response and insufficient information. Please feel free to comment with the requested information and the issue can be reopened.

@ppirrip
Copy link

ppirrip commented Jan 29, 2018

I got the same issue on setup tool missing the layout option, and seems
-DSETUPTOOLS_DEB_LAYOUT=OFF
resolved the issue. What additional information is required?

I am building on Ubuntu 17.10 Artful (faking to be zesty according to https://answers.ros.org/question/277021/ros-lunar-on-ubuntu-1710/), using Python 3.6 (anaconda)

I am a bit new to this, so just let me know what is needed (and how would would be nice).

@dirk-thomas
Copy link
Member

What additional information is required?

As mentioned in a previous comment: #863 (comment)

@dfm794
Copy link

dfm794 commented Apr 18, 2018

I'll just add that I'm running into the same issue. seems I'm using version 39.0.1 of setuptools. Have tried conda install and pip install..neither route changes behavior. Not sure what to debug further as these are standard installs of setuptools.

@babadashagua
Copy link

@Grillen80 Thanks! Your solution works for me!

@forouher
Copy link

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.

@icolwell-as
Copy link

icolwell-as commented Dec 23, 2021

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: usdot-fhwa-stol/carma-base#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.

matlabbe added a commit to introlab/rtabmap_ros that referenced this issue Jan 7, 2022
Try to fix `error: option --install-layout not recognized`on noetic build.
See ros/catkin#863 (comment)
@orrblue
Copy link

orrblue commented Jan 11, 2022

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

@orrblue
Copy link

orrblue commented Jan 11, 2022

@icolwell-as please excuse my dumb question, but why do you say that Python 3.8 is not the system-install of python? I think Ubuntu 20.04 comes with Python 3.8 pre-installed. Is it because your Python 3.8 is inside of ~/.local... ? Mine is in /usr/bin/python3.8 when I do which python3.8 on Ubuntu 20.04 Thanks!

@icolwell-as
Copy link

@orrblue, thanks for sharing the catkin tools config option, forgot about that.

Regarding python: Yes, in my case I had the system-installed python 3.8 installed in /usr/bin, but it was being shadowed or ignored by the python that I had installed in ~/.local/lib. The version installed locally (in ~/.local/lib) happened to be also be version 3.8, but that was just a coincidence.

@harandK
Copy link

harandK commented Jan 21, 2022

@icolwell-as

Confirmed, 20.04 noetic downgrading setuptools works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants