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

empy version incompatibility #602

Closed
EduPonz opened this issue Nov 30, 2023 · 4 comments · Fixed by #603
Closed

empy version incompatibility #602

EduPonz opened this issue Nov 30, 2023 · 4 comments · Fixed by #603

Comments

@EduPonz
Copy link

EduPonz commented Nov 30, 2023

It seems that empy 4.0 (released ~6 h ago) has breaking changes which make colcon-core to fail miserably. This is breaking our CI as we simply install colcon and let the package manager to resolve the dependencies

Steps to reproduce

Doing the following:

docker run -it --rm ubuntu:22.04
# Within the container
apt update && apt install python3 python3-pip
pip3 install -U colcon-common-extensions
colcon

The colcon call fails with:

ERROR:colcon.colcon_core.extension_point:Exception loading extension 'colcon_core.environment_variable.powershell_command': cannot import name 'OVERRIDE_OPT' from 'em' (/usr/local/bin/em.py) The Python package 'empy' must be installed and 'em' must not be installed since both packages share the same namespace
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/colcon_core/extension_point.py", line 116, in load_extension_points
    extension_type = load_extension_point(name, value, group)
  File "/usr/local/lib/python3.10/dist-packages/colcon_core/extension_point.py", line 157, in load_extension_point
    return EntryPoint(name, value, group).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/dist-packages/colcon_powershell/shell/powershell.py", line 17, in <module>
    from colcon_core.shell.template import expand_template
  File "/usr/local/lib/python3.10/dist-packages/colcon_core/shell/template/__init__.py", line 19, in <module>
    raise e from None
  File "/usr/local/lib/python3.10/dist-packages/colcon_core/shell/template/__init__.py", line 10, in <module>
    from em import OVERRIDE_OPT
ImportError: cannot import name 'OVERRIDE_OPT' from 'em' (/usr/local/bin/em.py) The Python package 'empy' must be installed and 'em' must not be installed since both packages share the same namespace

usage: colcon [-h] [--log-base LOG_BASE] [--log-level LOG_LEVEL] {build,extension-points,extensions,graph,info,list,metadata,test,test-result,version-check} ...

Error: No verb provided

Tentative fix

Until colcon supports empy v4, one thing that I could do to get things back up and running was:

pip3 uninstall empy
pip3 install empy==3.3.4

Another way to fix the issue is to install empy 3.3.4 before installing colcon, that'd be:

pip3 install empy==3.3.4
pip3 install -U colcon-common-extensions
@pablogs9
Copy link

@EduPonz
Copy link
Author

EduPonz commented Nov 30, 2023

I don't have a proper environment here to test the change and open a PR, but I think that most likely the fix is as simple as setting the version here:

EmPy

That'd be something like: EmPy==3.3.4.

@ZhenshengLee
Copy link

Issue reproduced +1

@cottsay
Copy link
Member

cottsay commented Nov 30, 2023

I'll version-bind the dependency tomorrow. Thanks for reporting.

@cottsay cottsay linked a pull request Nov 30, 2023 that will close this issue
@cottsay cottsay closed this as completed Nov 30, 2023
moriarty added a commit to PickNikRobotics/ros2_robotiq_gripper that referenced this issue Feb 8, 2024
- colcon/colcon-core#602
- ros-tooling/setup-ros#632

Signed-off-by: Alex Moriarty <alex.moriarty@picknik.ai>
moriarty added a commit to PickNikRobotics/ros2_robotiq_gripper that referenced this issue Feb 15, 2024
- colcon/colcon-core#602
- ros-tooling/setup-ros#632

Signed-off-by: Alex Moriarty <alex.moriarty@picknik.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants