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

ModuleNotFoundError: No module named 'ament_package' #11

Open
wshackle opened this issue Dec 6, 2022 · 2 comments
Open

ModuleNotFoundError: No module named 'ament_package' #11

wshackle opened this issue Dec 6, 2022 · 2 comments

Comments

@wshackle
Copy link

wshackle commented Dec 6, 2022

Following the instructions on https://github.com/esteve/ros2_java/blob/master/README.md#desktop
from the link on https://github.com/ros2-java/ros2_java_examples

the command
src/ament/ament_tools/scripts/ament.py build --symlink-install --isolated

produces an error

shackle@unimate:~/ament_ws$ src/ament/ament_tools/scripts/ament.py build --symlink-install --isolated
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(

Topological order

  • ament_cppcheck
  • ament_flake8
  • ament_package
  • ament_cmake_core
  • ament_cmake_export_definitions
  • ament_cmake_export_dependencies
  • ament_cmake_export_include_directories
  • ament_cmake_export_interfaces
  • ament_cmake_export_libraries
  • ament_cmake_export_link_flags
  • ament_cmake_gmock
  • ament_cmake_gtest
  • ament_cmake_include_directories
  • ament_cmake_libraries
  • ament_cmake
  • ament_cmake_nose
  • ament_cmake_pytest
  • ament_cmake_python
  • ament_cmake_target_dependencies
  • ament_cmake_test
  • ament_cmake_auto
  • ament_lint_auto
  • ament_pep257
  • ament_copyright
  • ament_clang_format
  • ament_cpplint
  • ament_index_python
  • ament_lint_cmake
  • ament_cmake_lint_cmake
  • ament_cmake_copyright
  • ament_cmake_clang_format
  • ament_cmake_cppcheck
  • ament_cmake_cpplint
  • ament_cmake_flake8
  • ament_cmake_pclint
  • ament_cmake_pep257
  • ament_cmake_pep8
  • ament_cmake_pyflakes
  • ament_cmake_uncrustify
  • ament_pclint
  • ament_pep8
  • ament_pyflakes
  • gmock_vendor
  • gtest_vendor
  • osrf_pycommon
  • ament_tools
  • uncrustify_vendor
  • ament_uncrustify
  • ament_lint_common
  • ament_index_cpp
  • ament_java_resources
  • ament_build_type_gradle

Process package 'ament_cppcheck' with context:

source_space => /home/shackle/ament_ws/src/ament/ament_lint/ament_cppcheck
build_space => /home/shackle/ament_ws/build_isolated/ament_cppcheck
install_space => /home/shackle/ament_ws/install_isolated/ament_cppcheck
make_flags => -j8, -l8
build_tests => False

+++ Building 'ament_cppcheck'
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
+++ Installing 'ament_cppcheck'
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/share/ament_cppcheck/package.xml
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/share/ament_cppcheck/environment/ament_prefix_path.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/share/ament_cppcheck/environment/path.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/share/ament_cppcheck/environment/pythonpath.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/share/ament_cppcheck/local_setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/share/ament_cppcheck/local_setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/share/ament_cppcheck/local_setup.zsh
==> '. /home/shackle/ament_ws/build_isolated/ament_cppcheck/ament_python__install.sh && /usr/bin/python3 setup.py develop --prefix /home/shackle/ament_ws/install_isolated/ament_cppcheck --no-deps' in '/home/shackle/ament_ws/build_isolated/ament_cppcheck'
running develop
/usr/local/lib/python3.10/dist-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
running egg_info
writing ament_cppcheck.egg-info/PKG-INFO
writing dependency_links to ament_cppcheck.egg-info/dependency_links.txt
writing entry points to ament_cppcheck.egg-info/entry_points.txt
writing requirements to ament_cppcheck.egg-info/requires.txt
writing top-level names to ament_cppcheck.egg-info/top_level.txt
reading manifest file 'ament_cppcheck.egg-info/SOURCES.txt'
writing manifest file 'ament_cppcheck.egg-info/SOURCES.txt'
running build_ext
Creating /home/shackle/ament_ws/install_isolated/ament_cppcheck/lib/python3.10/site-packages/ament-cppcheck.egg-link (link to .)
ament-cppcheck 0.5.2 is already the active version in easy-install.pth
Installing ament_cppcheck script to /home/shackle/ament_ws/install_isolated/ament_cppcheck/bin

Installed /home/shackle/ament_ws/build_isolated/ament_cppcheck
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/local_setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/local_setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/local_setup.zsh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/setup.zsh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_cppcheck/_order_packages.py

Process package 'ament_flake8' with context:

source_space => /home/shackle/ament_ws/src/ament/ament_lint/ament_flake8
build_space => /home/shackle/ament_ws/build_isolated/ament_flake8
install_space => /home/shackle/ament_ws/install_isolated/ament_flake8
make_flags => -j8, -l8
build_tests => False

+++ Building 'ament_flake8'
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
+++ Installing 'ament_flake8'
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/share/ament_flake8/package.xml
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/share/ament_flake8/environment/ament_prefix_path.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/share/ament_flake8/environment/path.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/share/ament_flake8/environment/pythonpath.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/share/ament_flake8/local_setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/share/ament_flake8/local_setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/share/ament_flake8/local_setup.zsh
==> '. /home/shackle/ament_ws/build_isolated/ament_flake8/ament_python__install.sh && /usr/bin/python3 setup.py develop --prefix /home/shackle/ament_ws/install_isolated/ament_flake8 --no-deps' in '/home/shackle/ament_ws/build_isolated/ament_flake8'
running develop
/usr/local/lib/python3.10/dist-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
running egg_info
writing ament_flake8.egg-info/PKG-INFO
writing dependency_links to ament_flake8.egg-info/dependency_links.txt
writing entry points to ament_flake8.egg-info/entry_points.txt
writing requirements to ament_flake8.egg-info/requires.txt
writing top-level names to ament_flake8.egg-info/top_level.txt
reading manifest file 'ament_flake8.egg-info/SOURCES.txt'
writing manifest file 'ament_flake8.egg-info/SOURCES.txt'
running build_ext
Creating /home/shackle/ament_ws/install_isolated/ament_flake8/lib/python3.10/site-packages/ament-flake8.egg-link (link to .)
ament-flake8 0.5.2 is already the active version in easy-install.pth
Installing ament_flake8 script to /home/shackle/ament_ws/install_isolated/ament_flake8/bin

Installed /home/shackle/ament_ws/build_isolated/ament_flake8
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/local_setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/local_setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/local_setup.zsh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/setup.zsh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_flake8/_order_packages.py

Process package 'ament_package' with context:

source_space => /home/shackle/ament_ws/src/ament/ament_package
build_space => /home/shackle/ament_ws/build_isolated/ament_package
install_space => /home/shackle/ament_ws/install_isolated/ament_package
make_flags => -j8, -l8
build_tests => False

+++ Building 'ament_package'
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
+++ Installing 'ament_package'
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/share/ament_package/package.xml
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/share/ament_package/environment/ament_prefix_path.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/share/ament_package/environment/path.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/share/ament_package/environment/pythonpath.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/share/ament_package/local_setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/share/ament_package/local_setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/share/ament_package/local_setup.zsh
==> '. /home/shackle/ament_ws/build_isolated/ament_package/ament_python__install.sh && /usr/bin/python3 setup.py develop --prefix /home/shackle/ament_ws/install_isolated/ament_package --no-deps' in '/home/shackle/ament_ws/build_isolated/ament_package'
running develop
/usr/local/lib/python3.10/dist-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.10/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
running egg_info
writing ament_package.egg-info/PKG-INFO
writing dependency_links to ament_package.egg-info/dependency_links.txt
writing top-level names to ament_package.egg-info/top_level.txt
reading manifest file 'ament_package.egg-info/SOURCES.txt'
writing manifest file 'ament_package.egg-info/SOURCES.txt'
running build_ext
Creating /home/shackle/ament_ws/install_isolated/ament_package/lib/python3.10/site-packages/ament-package.egg-link (link to .)
ament-package 0.5.2 is already the active version in easy-install.pth

Installed /home/shackle/ament_ws/build_isolated/ament_package
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/local_setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/local_setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/local_setup.zsh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/setup.bash
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/setup.sh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/setup.zsh
-- [ament] Deploying: /home/shackle/ament_ws/install_isolated/ament_package/_order_packages.py

Process package 'ament_cmake_core' with context:

source_space => /home/shackle/ament_ws/src/ament/ament_cmake/ament_cmake_core
build_space => /home/shackle/ament_ws/build_isolated/ament_cmake_core
install_space => /home/shackle/ament_ws/install_isolated/ament_cmake_core
make_flags => -j8, -l8
build_tests => False

+++ Building 'ament_cmake_core'
==> '. /home/shackle/ament_ws/build_isolated/ament_cmake_core/cmake__build.sh && /usr/bin/cmake -DBUILD_TESTING=0 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/shackle/ament_ws/install_isolated/ament_cmake_core /home/shackle/ament_ws/src/ament/ament_cmake/ament_cmake_core' in '/home/shackle/ament_ws/build_isolated/ament_cmake_core'
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Override CMake install command with custom implementation using symlinks instead of copying resources
-- ament_cmake_core 0.5.1
Traceback (most recent call last):
File "/home/shackle/ament_ws/src/ament/ament_cmake/ament_cmake_core/cmake/package_templates/templates_2_cmake.py", line 21, in
from ament_package.templates import get_environment_hook_template_path
ModuleNotFoundError: No module named 'ament_package'
CMake Error at ament_cmake_package_templates-extras.cmake:41 (message):
execute_process(/usr/bin/python3
/home/shackle/ament_ws/src/ament/ament_cmake/ament_cmake_core/cmake/package_templates/templates_2_cmake.py
/home/shackle/ament_ws/build_isolated/ament_cmake_core/ament_cmake_package_templates/templates.cmake)
returned error code 1
Call Stack (most recent call first):
CMakeLists.txt:19 (include)

-- Configuring incomplete, errors occurred!
See also "/home/shackle/ament_ws/build_isolated/ament_cmake_core/CMakeFiles/CMakeOutput.log".

<== Command '. /home/shackle/ament_ws/build_isolated/ament_cmake_core/cmake__build.sh && /usr/bin/cmake -DBUILD_TESTING=0 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/shackle/ament_ws/install_isolated/ament_cmake_core /home/shackle/ament_ws/src/ament/ament_cmake/ament_cmake_core' failed in '/home/shackle/ament_ws/build_isolated/ament_cmake_core' with exit code '1'
<== Command '. /home/shackle/ament_ws/build_isolated/ament_cmake_core/cmake__build.sh && /usr/bin/cmake -DBUILD_TESTING=0 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/shackle/ament_ws/install_isolated/ament_cmake_core /home/shackle/ament_ws/src/ament/ament_cmake/ament_cmake_core' failed in '/home/shackle/ament_ws/build_isolated/ament_cmake_core' with exit code '1'

@esteve
Copy link
Member

esteve commented Dec 6, 2022

@wshackle those instructions are from my fork, which hasn't been updated in a while. Could you try the instructions from this repository (https://github.com/ros2-java/ros2_java) ? Thanks.

@wshackle
Copy link
Author

wshackle commented Dec 6, 2022 via email

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