user1234440
user1234440

Reputation: 23567

Importing Confusion Pandas

I had 0.71 pandas before today. I tried to update and I simply ran the .exe file supplied by the website.

now I tried " import pandas" but then it gives me an error

ImportError: C extensions not built: if you installed already verify that you are not importing from the source directory.

I am new to python and pandas in general. Anything will help.

thanks,

Upvotes: 4

Views: 2368

Answers (3)

Alok
Alok

Reputation: 3290

I had the same error. I did not build pandas myself so i thought i should not get this error as mentioned on the pandas site. So i was confused on how to resolved this error. The pandas site says that matplotlib is an optional depenedency so i didn't install it initially. But interestingly, after installing matplotlib the error disappeared. I am not sure what effect it had. it found something!

Upvotes: 0

pynoob
pynoob

Reputation: 71

Had the same issue. Resolved by checking dependencies - make sure you have numpy > 1.6.1 and python-dateutil > 1.5 installed.

Upvotes: 1

Wes McKinney
Wes McKinney

Reputation: 105471

Are you by chance doing import pandas inside a directory containing the source code from PyPI or GitHub? Alternately, you may be missing a dependency that was not checked for in 0.7.1. If you are not importing from a source directory, could you please edit the pandas/init.py file (in C:\Python27\Lib\site-packages) to have a print statement after the import of pandas._tseries and show me what it says:

try:
    import pandas._tseries as lib
except Exception, e:  # pragma: no cover

    print e # <-- ADD THIS LINE

    if 'No module named' in str(e):
        raise ImportError('C extensions not built: if you installed already '
                          'verify that you are not importing from the source '
                          'directory')
    else:
        raise

If you could move this to the issue tracker that would be preferred. Thanks!

Upvotes: 3

Related Questions