Ask Your Question
0

cannot import interpreter

asked 2019-02-22 10:07:49 -0500

LCD gravatar image

updated 2019-02-22 10:11:20 -0500

gvdhoorn gravatar image

When building ROS2 on Windows using this command on Visual studio command prompt

colcon build --merge install

It shows the error:

Exception loading extension 'colcon_core.environment_variable.powershell_command': cannot import name 'Interpreter' from 'em' (c:\python37\lib\site-packages\em\__init__.py)
Traceback (most recent call last):
  File "c:\python37\lib\site-packages\colcon_core\entry_point.py", line 98, in load_entry_points
    extension_type = load_entry_point(entry_point)
  File "c:\python37\lib\site-packages\colcon_core\entry_point.py", line 140, in load_entry_point
    return entry_point.load()
  File "c:\python37\lib\site-packages\pkg_resources\__init__.py", line 2411, in load
    return self.resolve()
  File "c:\python37\lib\site-packages\pkg_resources\__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "c:\python37\lib\site-packages\colcon_powershell\shell\powershell.py", line 17, in <module>
    from colcon_core.shell.template import expand_template
  File "c:\python37\lib\site-packages\colcon_core\shell\template\__init__.py", line 8, in <module>
    from em import Interpreter
ImportError: cannot import name 'Interpreter' from 'em' (c:\python37\lib\site-packages\em\__init__.py)

Does anyone know how to resolve this problem?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-22 10:30:34 -0500

Dirk Thomas gravatar image

It looks like you have the wrong dependency installed. You need https://pypi.org/project/EmPy/ (not https://pypi.org/project/em/ ).

edit flag offensive delete link more

Comments

I did install EmPy using :

pip install -U catkin_pkg EmPy git+https://github.com/lark-parser/lark.git@0.7d pyparsing pyyaml

Should I uninstall em in this case?

Thanks!

LCD gravatar image LCD  ( 2019-02-22 10:57:16 -0500 )edit

That might be necessary if both packages use the same module name.

Dirk Thomas gravatar image Dirk Thomas  ( 2019-02-22 10:58:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-02-22 10:07:49 -0500

Seen: 314 times

Last updated: Feb 22 '19