Robotics StackExchange | Archived questions

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'

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'

Asked by Mathanraj_Sharma on 2020-12-17 01:08:06 UTC

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.

Asked by Acoker251 on 2020-12-20 11:59:53 UTC

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.

Asked by Sean Yen on 2020-12-22 19:22:02 UTC

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'

Asked by Acoker251 on 2020-12-22 21:02:24 UTC

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

Asked by Sean Yen on 2020-12-28 22:07:52 UTC

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

Asked by Mathanraj_Sharma on 2020-12-29 00:39:28 UTC

Answers