-1

我想在我的 python 程序中使用 matplotlib。但我得到了以下错误。那是什么?

      import matplotlib.pyplot as plt
      File "C:\Program Files\Python27\lib\site-packages\matplotlib\pyplot.py", line
    24, in <module>
        import matplotlib.colorbar
      File "C:\Program Files\Python27\lib\site-packages\matplotlib\colorbar.py", lin
    e 29, in <module>
        import matplotlib.collections as collections
      File "C:\Program Files\Python27\lib\site-packages\matplotlib\collections.py",
    line 23, in <module>
        import matplotlib.backend_bases as backend_bases
      File "C:\Program Files\Python27\lib\site-packages\matplotlib\backend_bases.py"
    , line 50, in <module>
        import matplotlib.textpath as textpath
      File "C:\Program Files\Python27\lib\site-packages\matplotlib\textpath.py", lin
    e 5, in <module>
        import urllib
      File "C:\Program Files\Python27\lib\urllib.py", line 26, in <module>
        import socket
      File "C:\Program Files\Python27\lib\socket.py", line 47, in <module>
        import _socket
   ImportError: No module named _socket
4

1 回答 1

0

尝试将“C:\ [PythonDir] \DLLs”添加到 PYTHONPATH 环境变量中。那应该可以解决问题

于 2013-10-17T05:39:27.307 回答