我收到ModuleNotFoundError:Ubuntu 18.04上没有名为_socket的模块

时间:2019-03-08 06:24:09

标签: python python-3.x sockets ubuntu anaconda

我在ubuntu上安装了Anaconda3,并在.bashrc文件中将路径更改为〜/ anaconda / bin,然后尝试安装keras。这引发了此错误。

hemanth@specter:~$ python3 -m pip install keras
Traceback (most recent call last):
  File "/home/hemanth/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/hemanth/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/hemanth/anaconda3/lib/python3.7/site-packages/pip/__main__.py", line 16, in <module>
    from pip._internal import main as _main  # isort:skip # noqa
  File "/home/hemanth/anaconda3/lib/python3.7/site-packages/pip/_internal/__init__.py", line 19, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
  File "/home/hemanth/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/home/hemanth/anaconda3/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 7, in <module>
    from socket import error as SocketError, timeout as SocketTimeout
  File "/home/hemanth/anaconda3/lib/python3.7/socket.py", line 49, in <module>
    import _socket
ModuleNotFoundError: No module named '_socket'

1 个答案:

答案 0 :(得分:0)

我尝试了此命令,它运行正常。

但是,尝试使用pip install sockets安装套接字,然后再次尝试安装keras。