我试图导入matplotlib和pandas,就像这样(但分别):
import matplotlib.pyplot
import pandas
,但是每次都出错。当我进口大熊猫时,它说
Traceback (most recent call last):
File "<pyshell#36>", line 1, in <module>
import pandas
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pandas\__init__.py", line 23, in <module>
from pandas.compat.numpy import *
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pandas\compat\__init__.py", line 439, in <module>
from dateutil import parser as _date_parser
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\dateutil\parser\__init__.py", line 2, in <module>
from ._parser import parse, parser, parserinfo
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\dateutil\parser\_parser.py", line 43, in <module>
from six import binary_type, integer_types, text_type
ImportError: cannot import name 'binary_type'
所以我进入命令提示符(windows)并尝试了pip install --upgrade pandas
和pip install binary_type
,但是它们都不起作用。
当我导入matplotlib时,它说
Traceback (most recent call last):
File "<pyshell#40>", line 1, in <module>
import matplotlib.pyplot
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\matplotlib\__init__.py", line 127, in <module>
from . import cbook
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\matplotlib\cbook\__init__.py", line 12, in <module>
from six.moves import xrange, zip
ImportError: No module named 'six.moves'; 'six' is not a package
就像我做pip install --upgrade six
,pip install six
和pip install six.move
之前一样,但是这些都不起作用。
我应该怎么做才能使这两个模块都能正常工作?