无法导入 pandas :TypeError [英] Could not Import Pandas: TypeError

查看:45
本文介绍了无法导入 pandas :TypeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用以下熊猫,但根本无法导入.

I wanted to use the following pandas, but could not import it at all.

https://github.com/pydata/pandas/releases/download/v0.15.0/pandas-0.15.0.win-amd64-py2.7.exe

但是我无法导入它:

import pandas as pd

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pandas as pd
  File "C:\Python27\lib\site-packages\pandas\__init__.py", line 45, in <module>
    from pandas.io.api import *
  File "C:\Python27\lib\site-packages\pandas\io\api.py", line 15, in <module>
    from pandas.io.gbq import read_gbq
  File "C:\Python27\lib\site-packages\pandas\io\gbq.py", line 39, in <module>
    if LooseVersion(_GOOGLE_API_CLIENT_VERSION >= '1.2.0'):
  File "C:\Python27\lib\distutils\version.py", line 265, in __init__
    self.parse(vstring)
  File "C:\Python27\lib\distutils\version.py", line 274, in parse
    self.component_re.split(vstring))
TypeError: expected string or buffer

你们怎么了?

推荐答案

在将google-api-python-client升级到高于1.2.0的版本时,这发生在我身上. 问题出在熊猫身上,但已得到解决: https://github.com/pydata/pandas/commit/403f38da35ab04d3997f61db3c98134fe02910d3

This happened to me when upgrading google-api-python-client to a version higher than 1.2.0. The problem is in Pandas, but it has been fixed: https://github.com/pydata/pandas/commit/403f38da35ab04d3997f61db3c98134fe02910d3

解决方案是降级google-api-python-client,自己修复熊猫中的行或等待熊猫0.15.1

The solutions is to either downgrade google-api-python-client, fix the lines in pandas yourself or wait for pandas 0.15.1

这篇关于无法导入 pandas :TypeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆