致命的Python错误-删除源根目录后无法在PyCharm中运行脚本

问题描述 投票:0回答:1

我删除了源根目录(自己的库),此后,我无法使用Pycharm执行.py文件。我试图重新安装PyCharm,但这并没有帮助。这是发生的错误:

C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\python.exe C:/Users/bruno/Dropbox/PythonProjects/auth_file.py
Error processing line 1 of C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\site-packages\matplotlib-3.1.1-py3.7-nspkg.pth:

Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\site.py", line 168, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "C:\Users\bruno\Dropbox\PythonProjects\Libraries\core\types.py", line 12, in <module>
    from typing import Tuple, Union, Mapping, List, NamedTuple
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\typing.py", line 28, in <module>
    import re as stdlib_re  # Avoid confusion with the re we export.
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\re.py", line 122, in <module>
    import enum
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
ImportError: cannot import name 'MappingProxyType' from 'types' (C:\Users\bruno\Dropbox\PythonProjects\Libraries\core\types.py)

这只是一些文字,以避免出现以下错误:It looks like your post is mostly code; please add some more details.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\site.py", line 579, in <module>
    main()
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\site.py", line 566, in main
    known_paths = addsitepackages(known_paths)
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\site.py", line 349, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\site.py", line 207, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\site.py", line 178, in addpackage
    import traceback
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\traceback.py", line 5, in <module>
    import linecache
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\linecache.py", line 11, in <module>
    import tokenize
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\tokenize.py", line 33, in <module>
    import re
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\re.py", line 122, in <module>
    import enum
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
  File "C:\Users\bruno\Dropbox\PythonProjects\Libraries\core\types.py", line 12, in <module>
    from typing import Tuple, Union, Mapping, List, NamedTuple
  File "C:\Users\bruno\AppData\Local\Programs\Python\Python37-32\lib\typing.py", line 31, in <module>
    from types import WrapperDescriptorType, MethodWrapperType, MethodDescriptorType
ImportError: cannot import name 'WrapperDescriptorType' from 'types' (C:\Users\bruno\Dropbox\PythonProjects\Libraries\core\types.py)

Process finished with exit code 1
python pycharm
1个回答
0
投票

我认为这是Python问题,不是吗?您是否尝试过重新安装python?

热门问题
推荐问题
最新问题