在python 3.7中导入panda时出错

在python 3.7中导入panda时出错,python,python-3.x,Python,Python 3.x,导入panda时获取错误 Traceback (most recent call last): File "C:/Users/kj/PycharmProjects/kj/parsing.py", line 5, in <module> import pandas File "H:\Python\New\lib\pandas\__init__.py", line 23, in <module> from pandas.compat.numpy imp

导入panda时获取错误

Traceback (most recent call last):
  File "C:/Users/kj/PycharmProjects/kj/parsing.py", line 5, in <module>
    import pandas
  File "H:\Python\New\lib\pandas\__init__.py", line 23, in <module>
    from pandas.compat.numpy import *
  File "H:\Python\New\lib\pandas\compat\__init__.py", line 421, in <module>
    if LooseVersion(dateutil.__version__) < LooseVersion('2.5'):
  File "C:\Program Files\Python\Python37\Lib\distutils\version.py", line 52, in __lt__
    c = self._cmp(other)
  File "C:\Program Files\Python\Python37\Lib\distutils\version.py", line 337, in _cmp
    if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'

import pandas
df = pandas.read_excel(open('Test.csv','rb'), sheetname='Sheet 1')
grouped = df.groupby('Date (IT)')
回溯(最近一次呼叫最后一次):
文件“C:/Users/kj/PycharmProjects/kj/parsing.py”,第5行,在
进口大熊猫
文件“H:\Python\New\lib\pandas\\uuuuu init\uuuuuu.py”,第23行,在
从pandas.compat.numpy导入*
文件“H:\Python\New\lib\pandas\compat\\uuuuu init\uuuuuu.py”,第421行,在
如果LooseVersion(dateutil.\uuuuuuuuu版本)TypeError:“我目前没有安装PyCharm,但您可以在命令行中尝试运行:

pip uninstall pandas 
然后是重新安装:
pip-install-pandas


或者你也可以试着从PyCharm那里运行它。它将自动建议安装缺少的软件包。

看起来您的
日期(It)
列包含混合值(字符串和整数、日期或缺少值)。因此,当熊猫尝试比较每个值时,由于类型不同,它失败了。请查看列数据,确保所有数据的格式有效。

这是一个非常奇怪的错误。您是否更改了熊猫核心文件?如果没有,我会推荐一个新的安装程序。github中是否有任何具有所有依赖项的panda软件包,因为我不允许连接其他网站。我将能够从github下载并将其放在python路径中。看起来错误源于
import
语句,对吗?假设回溯是按原样复制的,并且没有丢失信息。所以问题出在熊猫身上,而不是OP的数据