简体   繁体   English

ModuleNotFoundError:尽管在 carla-ros-bridge wsl-2 中使用 colcon build 时安装了 empy,但没有名为“em”的模块

[英]ModuleNotFoundError: No module named 'em' despite empy being installed when using colcon build in carla-ros-bridge wsl-2

When running colcon build in the carla-ros-bridge root directory in wsl-2, python throws ModuleNotFoundError: No module named 'em' .在 wsl-2 的 carla-ros-bridge 根目录中运行 colcon build 时, python 抛出ModuleNotFoundError: No module named 'em' Specifically, it produces this output:具体来说,它会产生这个 output:

--- stderr: carla_ros_scenario_runner_types
CMake Error at /opt/ros/foxy/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:60 (message):
  execute_process(/home/jakob/miniconda3/bin/python3 -m rosidl_adapter
  --package-name carla_ros_scenario_runner_types --arguments-file
  /home/jakob/carla-ros-bridge/build/carla_ros_scenario_runner_types/rosidl_adapter__arguments__carla_ros_scenario_runner_types.json
  --output-dir
  /home/jakob/carla-ros-bridge/build/carla_ros_scenario_runner_types/rosidl_adapter/carla_ros_scenario_runner_types
  --output-file
  /home/jakob/carla-ros-bridge/build/carla_ros_scenario_runner_types/rosidl_adapter/carla_ros_scenario_runner_types.idls)
  returned error code 1:

  Traceback (most recent call last):

    File "/home/jakob/miniconda3/lib/python3.10/runpy.py", line 196, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/home/jakob/miniconda3/lib/python3.10/runpy.py", line 86, in _run_code
      exec(code, run_globals)
    File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_adapter/__main__.py", line 19, in <module>
      sys.exit(main())
    File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_adapter/main.py", line 53, in main
      abs_idl_file = convert_to_idl(
    File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_adapter/__init__.py", line 18, in convert_to_idl
      from rosidl_adapter.msg import convert_msg_to_idl
    File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_adapter/msg/__init__.py", line 16, in <module>
      from rosidl_adapter.resource import expand_template
    File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_adapter/resource/__init__.py", line 19, in <module>
      import em

  ModuleNotFoundError: No module named 'em'

Call Stack (most recent call first):
  /opt/ros/foxy/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:130 (rosidl_adapt_interfaces)
  CMakeLists.txt:39 (rosidl_generate_interfaces)


---

I've read elsewhere that this error is caused by the package "empy" missing, so I ran pip3 install empy and pip install empy , both produced the output: Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: empy in /home/jakob/.local/lib/python3.8/site-packages (3.3.4)我在别处读到这个错误是由 package “empy” 丢失引起的,所以我运行pip3 install empypip install empy ,都产生了 output: Defaulting Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: empy in /home/jakob/.local/lib/python3.8/site-packages (3.3.4)

python -V outputs: Python 2.7.18 python3 -V outputs: Python 3.8.10 python -V 输出:Python 2.7.18 python3 -V 输出:Python 3.8.10

I'm running out of ideas to fix this我没有办法解决这个问题

I tried: -Installing em and running the build again (throws different error message) -reinstalling empy (no changes) -removing the carla-ros-bridge root directory and cloning it again我试过: - 安装 em 并再次运行构建(抛出不同的错误消息) - 重新安装 empy (无更改) - 删除 carla-ros-bridge 根目录并再次克隆它

I found the error.我发现了错误。 If you take a look at the Traceback, you'll see that Python uses two different paths to two different versions.如果查看 Traceback,您会发现 Python 使用两个不同的路径指向两个不同的版本。 Specifically /home/jakob/miniconda3/lib/python3.10/ and /opt/ros/foxy/lib/python3.8/site-packages/ .特别/home/jakob/miniconda3/lib/python3.10//opt/ros/foxy/lib/python3.8/site-packages/ This was due to me building ros foxy in a different miniconda environment than the carla-ros-bridge.这是因为我在与 carla-ros-bridge 不同的 miniconda 环境中构建 ros foxy。 The fix was deleting the carla ros bridge and downloading and then building it again in an environment that used python 3.8.修复是删除 carla ros 桥并下载,然后在使用 python 3.8 的环境中再次构建它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:尽管安装了模块,但没有名为“tf_slim”的模块 - ModuleNotFoundError: No module named 'tf_slim' despite installing mysql 在 wsl-2 上没有 sudo - mysql without sudo on wsl-2 ModuleNotFoundError: 没有名为“基数”的模块 - ModuleNotFoundError: No module named 'radix' ModuleNotFoundError:pipenv 中没有名为“dlib”的模块 - ModuleNotFoundError: No module named 'dlib' in pipenv Ubuntu 导入错误:没有模块命名 - 尽管已安装。 是否存在用户权限问题或类似问题 - Ubuntu Import Error: No module named -— despite having been installed. Could there be a user permission issue or similar ModuleNotFoundError:ubuntu 上没有名为“龙卷风”的模块 - ModuleNotFoundError: No module named 'tornado' on ubuntu Django Apache 2 ModuleNotFoundError:没有名为“django”的模块 - Django Apache 2 ModuleNotFoundError: No module named 'django' ModuleNotFoundError:没有名为“pyodbc”的模块 - Azure 批次 - Ubuntu - ModuleNotFoundError: No module named 'pyodbc' - Azure Batch - Ubuntu 没有名为 django 的模块,但已安装 - No module named django but it is installed 尽管已安装并配置了 python 路径,但 wsgi + apache 中的 ModuleNotFoundError - ModuleNotFoundError in wsgi + apache despite installed and python path configured
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM