ROS Noetic Windows 10 Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' [closed]

asked 2020-12-17 00:08:27 -0500

Mathanraj_Sharma gravatar image

I installed ROS Noetic in windows 10 as explained in http://wiki.ros.org/Installation/Windows. I am able to catkin commands are working fine in my ROS terminal. But when I try to check

rospack depends1 beginner_turorial

I get this error.

Python path configuration:
  PYTHONHOME = 'C:\opt\ros\noetic\x64\'
  PYTHONPATH = 'c:\opt\ros\noetic\x64\lib/site-packages;c:\opt\ros\noetic\x64\Lib\site-packages'
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'c:\\opt\\ros\\noetic\\x64\\bin\\rospack.exe'
  sys.base_prefix = 'C:\\opt\\ros\\noetic\\x64\\'
  sys.base_exec_prefix = 'C:\\opt\\ros\\noetic\\x64\\'
  sys.executable = 'c:\\opt\\ros\\noetic\\x64\\bin\\rospack.exe'
  sys.prefix = 'C:\\opt\\ros\\noetic\\x64\\'
  sys.exec_prefix = 'C:\\opt\\ros\\noetic\\x64\\'
  sys.path = [
    'c:\\opt\\ros\\noetic\\x64\\lib/site-packages',
    'c:\\opt\\ros\\noetic\\x64\\Lib\\site-packages',
    'c:\\opt\\ros\\noetic\\x64\\bin\\python38.zip',
    'C:\\opt\\ros\\noetic\\x64\\\\DLLs',
    'C:\\opt\\ros\\noetic\\x64\\\\lib',
    'c:\\opt\\ros\\noetic\\x64\\bin',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Mathanraj_Sharma
close date 2020-12-28 23:39:54.014092

Comments

I am having this same issue but it seems nobody has an answer to this issue? However the module encodings is there under site-packages.

Acoker251 gravatar image Acoker251  ( 2020-12-20 10:59:53 -0500 )edit

Hi, I am from ROS on Windows team. This issue most likely is caused by a extra python38.dll under c:\opt\ros\noetic\x64\bin\python38.dll. Removing it should fix the issue and we are working on removing this extra file in the next release.

Sean Yen gravatar image Sean Yen  ( 2020-12-22 18:22:02 -0500 )edit

This is what I am getting after removing the python38.dll

I:\catkin_ws>rospack depends1 mapping_drone [rospack] Error: the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'

This is the last 3 lines of trace on update.

File "c:\opt\ros\noetic\x64\lib\site-packages\rosdep2\installers.py", line 328, in __init__ self.sudo_command = 'sudo -H' if os.geteuid() != 0 else '' AttributeError: module 'os' has no attribute 'geteuid'

Acoker251 gravatar image Acoker251  ( 2020-12-22 20:02:24 -0500 )edit

@Acoker251 A new release is out and I believe this issue was addressed. Can you retry again? Thanks!

Sean Yen gravatar image Sean Yen  ( 2020-12-28 21:07:52 -0500 )edit

@Sean_Yen now it is working for me. Thank you for your support.

Mathanraj_Sharma gravatar image Mathanraj_Sharma  ( 2020-12-28 23:39:28 -0500 )edit