天天看點

Fatal Python error: init_import_size: Failed to import the site module Python runtime state: initial

Fatal Python error: init_import_size: Failed to import the site module

Python runtime state: initialized

Traceback (most recent call last):

File “C:\python\python39\lib\site.py”, line 73, in

import os

File “C:\python\python39\lib\os.py”, line 29, in

from _collections_abc import _check_methods

File “C:\python\python39\lib_collections_abc.py”, line 12, in

GenericAlias = type(list[int])

TypeError: ‘type’ object is not subscriptable

C:\Users\Administrator>

解:

檢視自己的環境變量中是否有PythonHome的設定,删掉就好了。