简体   繁体   English

Python导入错误ModuleNotFoundError:停电后没有名为“ _ctypes”的模块

[英]Python import error ModuleNotFoundError: No module named '_ctypes', after power outage

There was a power outage in my area while i was working on a python script.After this happened, there was an error when i tried to import numpy. 我在使用python脚本时,我所在的地区断电。发生这种情况后,当我尝试导入numpy时出现错误。

ModuleNotFoundError: No module named '_ctypes'

In Pycharm,Project-> Settings ->Interpreter ,the package list is empty. 在Pycharm,项目->设置->解释器中,软件包列表为空。 Also, pip install produces this error, 此外, pip install产生此错误,

Traceback (most recent call last):
  File "C:\Users\soc\Anaconda3\Scripts\pip-script.py", line 6, in <module>
    from pip._internal import main
  File "C:\Users\soc\Anaconda3\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "C:\Users\soc\Anaconda3\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "C:\Users\soc\Anaconda3\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "C:\Users\soc\Anaconda3\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 17, in <module>
    from pip._internal.locations import USER_CACHE_DIR, src_prefix
  File "C:\Users\soc\Anaconda3\lib\site-packages\pip\_internal\locations.py", line 17, in <module>
    USER_CACHE_DIR = appdirs.user_cache_dir("pip")
  File "C:\Users\soc\Anaconda3\lib\site-packages\pip\_internal\utils\appdirs.py", line 38, in user_cache_dir
    path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA"))
  File "C:\Users\soc\Anaconda3\lib\site-packages\pip\_internal\utils\appdirs.py", line 194, in _get_win_folder_from_registry
    import _winreg
ModuleNotFoundError: No module named '_winreg'

Everything was working as expected before this incident.What could have changed due to power outage? 在此事件发生之前,一切都按预期进行。由于停电,可能发生了什么变化? How can i fix this this? 我该如何解决这个问题?

I saw a question very similar yours. 我看到了一个非常相似的问题。 Maybe it could help you: 也许它可以帮助您:

importError: no module named _winreg python3 importError:没有名为_winreg python3的模块

As it says in the _winreg documentation, it has been renamed to winreg in Python 3.0. 如_winreg文档中所述,它已在Python 3.0中重命名为winreg。 You should run the 2to3 tool if you're converting code that was written for Python 2.x. 如果要转换为Python 2.x编写的代码,则应运行2to3工具。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python3 create virtualenv 发现错误“ModuleNotFoundError: No module named '_ctypes'” - python3 create virtualenv found error "ModuleNotFoundError: No module named '_ctypes'" pyenv 失败:ModuleNotFoundError: No module named &#39;_ctypes&#39; 错误 - pyenv fails with : ModuleNotFoundError: No module named '_ctypes' error linux ModuleNotFoundError:没有名为&#39;_ctypes的模块 - linux ModuleNotFoundError: No module named '_ctypes ModuleNotFoundError:在 vs 代码 python 中没有名为导入错误的模块 - ModuleNotFoundError: No module named import error in vs-code python ModuleNotFoundError:没有名为“tensorflow.python.platform”的模块导入错误 - ModuleNotFoundError: No module named 'tensorflow.python.platform' Import error python “ModuleNotFoundError: No module named '_ctypes'” 共享主机上的错误(无法 sudo install libffi-dev) - python “ModuleNotFoundError: No module named '_ctypes'” error on a shared host (no ability to sudo install libffi-dev) ModuleNotFoundError:没有名为 Python 的模块错误 - ModuleNotFoundError: no module named Python Error Pyenv无法在Cygwin上安装python:ModuleNotFoundError:没有名为“ _ctypes”的模块 - Pyenv fails to install python on Cygwin: ModuleNotFoundError: No module named '_ctypes' Python导入ModuleNotFoundError:没有名为“模型”的模块 - Python import ModuleNotFoundError: No module named 'model' 导入错误-ModuleNotFoundError:没有名为“模型”的模块 - Import error - ModuleNotFoundError: No module named 'model'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM