Failed to import Pandas: TypeError

I wanted to use the following pandas but couldn't import it at all.

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

However, I was unable to import it:

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

      

What are the wrong guys?

+3


source to share


2 answers


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



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

+7


source


Maybe you should try: pip install pandas (by the way, you need to install pip first).



0


source







All Articles