黑窗口 ImportError: No module named '_socket'

未了解原因:

1、直接用管理员权限进入黑窗口,未进行任何操作显示错误:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\Anaconda3\lib\ctypes\__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ImportError: No module named '_ctypes'
Traceback (most recent call last):
  File "D:\Anaconda3\lib\site-packages\conda\cli\main.py", line 170, in main
    import conda.cli.activate as activate
  File "D:\Anaconda3\lib\site-packages\conda\cli\activate.py", line 10, in <module>
    from ..exceptions import (ArgumentError, CondaEnvironmentError, CondaSystemExit, CondaValueError,
  File "D:\Anaconda3\lib\site-packages\conda\exceptions.py", line 16, in <module>
    from .common.url import maybe_unquote
  File "D:\Anaconda3\lib\site-packages\conda\common\url.py", line 8, in <module>
    import socket
  File "D:\Anaconda3\lib\socket.py", line 49, in <module>
    import _socket
ImportError: No module named '_socket'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda3\Scripts\conda-script.py", line 10, in <module>
    sys.exit(main())
  File "D:\Anaconda3\lib\site-packages\conda\cli\main.py", line 177, in main
    from ..exceptions import handle_exception
  File "D:\Anaconda3\lib\site-packages\conda\exceptions.py", line 16, in <module>
    from .common.url import maybe_unquote
  File "D:\Anaconda3\lib\site-packages\conda\common\url.py", line 8, in <module>
    import socket
  File "D:\Anaconda3\lib\socket.py", line 49, in <module>
    import _socket
ImportError: No module named '_socket'

      在上述情况打开黑窗口或不用管理员权限,在文件夹直接打开黑窗口,pip无任何异常,可用。但是conda任何命令不可用,显示failed to create process。在网上查了很多有关的解决方案都没奏效,最后没办法只能卸载Anaconda3,再重新安装,才得以解决。如果你知道这是为什么,求不卸载Anaconda3的解决方案。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值