ROS on Windows Noetic failed to build an empty workspace - utf8 decode error

asked 2021-01-14 16:42:14 -0500

CsorvaGep gravatar image

updated 2021-01-18 14:07:13 -0500

I've just installed ROS1 on Windows 10 on a relatively new install. I've followed the tutorial, which worked without any error. Then I created an empty workspace at C:\catkin_ws (with a catkin_init_workspace command inside src), then called catkin_make.

The cmake command failed with the following error:

-- catkin 0.8.9
Traceback (most recent call last):
  File "C:/catkin_ws/build/catkin_generated/", line 22, in <module>
    code = generate_environment_script('C:/catkin_ws/devel/env.bat')
  File "C:\opt\ros\noetic\x64\lib\site-packages\catkin\", line 63, in generate_environment_script
    env_after = ast.literal_eval(output.decode('utf8'))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 2928: invalid start byte
CMake Error at C:/opt/ros/noetic/x64/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  "C:/catkin_ws/build/catkin_generated/") returned
  error code 1
Call Stack (most recent call first):
  C:/opt/ros/noetic/x64/share/catkin/cmake/all.cmake:208 (safe_execute_process)
  C:/opt/ros/noetic/x64/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:58 (find_package)

I've tried to install ROS again, and did not help.

--- Edit: Turns out the problem is that I have some environment variables which is not encoded with utf8. After unsetting them the build works fine. I worte a small batch file to unset them before the build, but this is only a workaround.

edit retag flag offensive close merge delete


With melodic this works fine, and I didn't see any major change, I think this is related to the python 2->3 migration.

CsorvaGep gravatar image CsorvaGep  ( 2021-01-15 02:06:58 -0500 )edit

Based on your edit, I would recommend opening a bug report:

sloretz gravatar image sloretz  ( 2021-01-19 16:55:44 -0500 )edit