VS2019使用Keras.Net报错:Fatal Python error: initfsencoding: unable to load the file system codec. ModuleNotFoundError: No module named ‘encodings’

  • 情景:

    使用Keras.Net的Load_Model方法加载模型时,报错:【Fatal Python error: initfsencoding: unable to load the file system codec. ModuleNotFoundError: No module named ‘encodings’】

    VS2019使用Keras.Net报错:Fatal Python error: initfsencoding: unable to load the file system codec. Module

  • 环境:

    • Visual Studio 2019 Version 16.6.5
    • Keras.Net
    • Anacanda(Python 3.7.6)
    • Asp.Net Core Console
  • 方案:

    1. 右键【我的电脑】,点击【属性】,然后选择左侧的【高级系统设置】;

    2. 点击【环境变量】,打开系统环境变量配置;
      VS2019使用Keras.Net报错:Fatal Python error: initfsencoding: unable to load the file system codec. Module

    3. 选择系统环境变量中的【Path】,点击【编辑】,查看是否配置了Python的环境变量,如若没有,请配置;因为我使用的是Anaconda,所以配置的路径也就是Anaconda的路径;

      VS2019使用Keras.Net报错:Fatal Python error: initfsencoding: unable to load the file system codec. Module

      VS2019使用Keras.Net报错:Fatal Python error: initfsencoding: unable to load the file system codec. Module

    4. 配置完成后,还需要在用户变量中添加PYTHONHOMEPYTHONPATH两个变量;

      VS2019使用Keras.Net报错:Fatal Python error: initfsencoding: unable to load the file system codec. Module

    5. 接下来,最重要的一步,就是重启Visual Studio 2019,否则依旧会报错。

相关文章:

  • 2018-07-18
  • 2022-12-23
  • 2021-07-13
  • 2021-09-21
  • 2021-08-04
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2021-05-09
  • 2021-05-23
  • 2021-12-22
  • 2021-09-06
  • 2021-05-15
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案