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

colcon build --mixin release: moveit_task_constructor_core error #967

Open
2vin2vin opened this issue Sep 17, 2024 · 4 comments
Open

colcon build --mixin release: moveit_task_constructor_core error #967

2vin2vin opened this issue Sep 17, 2024 · 4 comments

Comments

@2vin2vin
Copy link

Description

Overview of your issue here.

Your environment

During colcon build got the below error
Starting >>> moveit
--- stderr: moveit_task_constructor_core
CMake Error at python/pybind11/tools/FindPythonLibsNew.cmake:163 (message):
Python config failure:

Traceback (most recent call last):

File "<string>", line 6, in <module>

ImportError: cannot import name 'sysconfig'

Call Stack (most recent call first):
python/pybind11/tools/pybind11Tools.cmake:50 (find_package)
python/pybind11/tools/pybind11Common.cmake:192 (include)
python/pybind11/CMakeLists.txt:254 (include)


Failed <<< moveit_task_constructor_core [1.30s, exited with code 1]

I seem to have sysconfig and it seems to work as well

I checked for the file FindPythonLibsNew.cmake and got the following
/home/2vin/.local/lib/python2.7/site-packages/pybind11/share/cmake/pybind11/FindPythonLibsNew.cmake
/home/2vin/.local/lib/python3.8/site-packages/pybind11/share/cmake/pybind11/FindPythonLibsNew.cmake

but I also seem to have the file in
/home/2vin/.local/lib/python3.10/site-packages/pybind11/share/cmake/pybind11/FindPythonLibsNew.cmake
but not detected in locate

so I have been trying everything I can since 2 days but unable to resolve it.

@rhaschke
Copy link
Contributor

Looks like you screwed your python environment. I guess, you have multiple python binaries and the wrong one is used.
The cmake file should come from moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake.
Maybe you can use colcon build --cmake-args --trace to get verbose cmake output and figure out which python binary is used.
As a last resort, I suggest cleaning up ~/.local/lib/python*. However, this might break other apps!

@2vin2vin
Copy link
Author

/home/2vin/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(129): execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
import sys;import struct;
import sysconfig as s
USE_SYSCONFIG = sys.version_info >= (3, 10)
if not USE_SYSCONFIG:
from distutils import sysconfig as ds
print('.'.join(str(v) for v in sys.version_info));
print(sys.prefix);
if USE_SYSCONFIG:
scheme = s.get_default_scheme()
if scheme == 'posix_local':
# Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
scheme = 'posix_prefix'
print(s.get_path('platinclude', scheme))
print(s.get_path('platlib'))
print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO'))
else:
print(ds.get_python_inc(plat_specific=True));
print(ds.get_python_lib(plat_specific=True));
print(ds.get_config_var('EXT_SUFFIX') or ds.get_config_var('SO'));
print(hasattr(sys, 'gettotalrefcount')+0);
print(struct.calcsize('@p'));
print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION'));
print(s.get_config_var('LIBDIR') or '');
print(s.get_config_var('MULTIARCH') or '');
RESULT_VARIABLE _PYTHON_SUCCESS OUTPUT_VARIABLE _PYTHON_VALUES ERROR_VARIABLE _PYTHON_ERROR_VALUE )
/home/ubuntu/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(161): if(NOT _PYTHON_SUCCESS MATCHES 0 )
/home/ubuntu/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(162): if(PythonLibsNew_FIND_REQUIRED )
/home/ubuntu/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(163): message(FATAL_ERROR Python config failure:\n${_PYTHON_ERROR_VALUE} )
CMake Error at python/pybind11/tools/FindPythonLibsNew.cmake:163 (message):
Python config failure:

Traceback (most recent call last):

File "<string>", line 6, in <module>

ImportError: cannot import name 'sysconfig'

Call Stack (most recent call first):
python/pybind11/tools/pybind11Tools.cmake:50 (find_package)
python/pybind11/tools/pybind11Common.cmake:192 (include)
python/pybind11/CMakeLists.txt:254 (include)


Failed <<< moveit_task_constructor_core [22.5s, exited with code 1]
I have also tried to check the python version from python terminal it seems to be 3.10 and also as you said it is being taken from moveit_task_constructor
I have actually upgraded fromubuntu 20 to 22 and then tries to install this and I have been facing issues continuously I have tried to resolve most of them but I am unable to solve this

@2vin2vin
Copy link
Author

/home/2vin/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(129): execute_process(COMMAND ${PYTHON_EXECUTABLE} -c import sys;import struct; import sysconfig as s USE_SYSCONFIG = sys.version_info >= (3, 10) if not USE_SYSCONFIG: from distutils import sysconfig as ds print('.'.join(str(v) for v in sys.version_info)); print(sys.prefix); if USE_SYSCONFIG: scheme = s.get_default_scheme() if scheme == 'posix_local': # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/ scheme = 'posix_prefix' print(s.get_path('platinclude', scheme)) print(s.get_path('platlib')) print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO')) else: print(ds.get_python_inc(plat_specific=True)); print(ds.get_python_lib(plat_specific=True)); print(ds.get_config_var('EXT_SUFFIX') or ds.get_config_var('SO')); print(hasattr(sys, 'gettotalrefcount')+0); print(struct.calcsize('@p')); print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION')); print(s.get_config_var('LIBDIR') or ''); print(s.get_config_var('MULTIARCH') or ''); RESULT_VARIABLE _PYTHON_SUCCESS OUTPUT_VARIABLE _PYTHON_VALUES ERROR_VARIABLE _PYTHON_ERROR_VALUE ) /home/ubuntu/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(161): if(NOT _PYTHON_SUCCESS MATCHES 0 ) /home/ubuntu/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(162): if(PythonLibsNew_FIND_REQUIRED ) /home/ubuntu/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake(163): message(FATAL_ERROR Python config failure:\n${_PYTHON_ERROR_VALUE} ) CMake Error at python/pybind11/tools/FindPythonLibsNew.cmake:163 (message): Python config failure:

Traceback (most recent call last):

File "<string>", line 6, in <module>

ImportError: cannot import name 'sysconfig'

Call Stack (most recent call first): python/pybind11/tools/pybind11Tools.cmake:50 (find_package) python/pybind11/tools/pybind11Common.cmake:192 (include) python/pybind11/CMakeLists.txt:254 (include)

Failed <<< moveit_task_constructor_core [22.5s, exited with code 1] I have also tried to check the python version from python terminal it seems to be 3.10 and also as you said it is being taken from moveit_task_constructor I have actually upgraded fromubuntu 20 to 22 and then tries to install this and I have been facing issues continuously I have tried to resolve most of them but I am unable to solve this

Also distutils.setuptools exists but it seems to be generating deprecated warning

@rhaschke
Copy link
Contributor

You still didn't figure out which python executable is called by cmake. Try to print the cmake variable PYTHON_EXECUTABLE in /home/2vin/ws_moveit/src/moveit_task_constructor/core/python/pybind11/tools/FindPythonLibsNew.cmake:129

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

No branches or pull requests

2 participants