Fatal Python error on Windows 10 ModuleNotFoundError: No module named 'encodings'

前端 未结 8 1651
青春惊慌失措
青春惊慌失措 2020-12-01 20:50

I\'m installing python on my windows 10 laptop, and when I try to run it I get this.

Fatal Python error: Py_Initialize: unable to load the file system

8条回答
  •  自闭症患者
    2020-12-01 21:23

    I had the same problem (I use a mac but I don't think it makes any difference in this problem) and it was coming from the difference between the selected python interpreter path and the current working directory in spyder.

    I use virtual environments in python to avoid version conflicts of installed modules between various projects (I believe it is a good practice). This leads me ton configure the interpreter path in spyder by accessing :

    preferences > python interpreter > use the following interpreter
    

    The problem comes when I launch spyder from a different path. I get exactly the same error as Milo's. To solve it I see 2 options :

    1. change the interpreter path to match the spyder working directory
    2. change the spyder working directory to match the python interpreter path

提交回复
热议问题