3

I am very new to Python and am trying to create a table in pandas with HDFStore as follows

store = HDFStore('store.h5')

I get the exception :

Exception                                 Traceback (most recent call last)
C:\Python27\<ipython-input-11-de3060b689e6> in <module>()
----> 1 store = HDFStore('store.h5')

C:\Python27\lib\site-packages\pandas-0.10.1-py2.7-win32.egg\pandas\io\pytables.pyc in __init__(self, path, mode, complevel, complib, fletcher32)
    196             import tables as _
    197         except ImportError:  # pragma: no cover
--> 198             raise Exception('HDFStore requires PyTables')
    199 
    200         self.path = path

Exception: HDFStore requires PyTables 

I already have Pytables installed and it is present in site-packages. Both pandas(0.l0.1) and pytables(2.4.0) are 32 bit Windows versions. Python version is 2.7.3 for 32 bit windows

I am running this using ipython notebook.

I forgot to add that I have Windows 7 - 64 bit OS, but Python and all its related add-ons are 32 bit.

5
  • What happens if you run import tables? Commented Mar 18, 2013 at 4:25
  • It throws an Import Error: ImportError Traceback (most recent call last) C:\Python27\<ipython-input-12-389ecae14f10> in <module>() ----> 1 import tables C:\Python27\lib\site-packages\tables\__init__.py in <module>() 67 68 # Necessary imports to get versions stored on the cython extension ---> 69 from tables.utilsExtension import getPyTablesVersion, getHDF5Version 70 71 ImportError: cannot import name getPyTablesVersion Commented Mar 18, 2013 at 5:44
  • I forgot to add that I have Windows 7 - 64 bit OS, but Python and all related add-ons are 32 bit, could that be an issue ? Commented Mar 18, 2013 at 5:52
  • I don't think so. How did you install pytables? Are you sure everything is compiled? You could try to use one of the setup files from here. Commented Mar 18, 2013 at 9:07
  • Thank you, I went back and realized that I have not compiled it correctly as I do not have the HDF5 library installed. Commented Mar 19, 2013 at 2:37

3 Answers 3

3

I also had the same error when using HDFStore. And I tried all the steps specified above and spent many hours to find a solution, but non of them were successful.

Then I downloaded and installed MiniConda. And then I used the below command to install pytables.

conda install -c conda-forge pytables

Please refer the below screenshot.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

I suspect your problem is that you have not added Python Scripts to your system PATH. Assuming that check out this tutorial on how to do it.

You are looking to add the C:\Python27, C:\Python27\Lib. and C:\Python27\Scripts. Make sure you separate each one with a ;. Also make sure you add it to your system PATH variable and not just your user PATH variable.

after all of that check import pytables. It should no longer throw and error, because python will be 'know' that pytables is installed and be able to locate it.

Comments

0

I had same problem. I am using win7 + anaconda python2.7 + IPython.

But I fixed it with following steps:

From http://www.lfd.uci.edu/~gohlke/pythonlibs/#pytables
download file tables‑3.2.1‑cp27‑none‑win_amd64.whl

and install it with cmd

pip install tables‑3.2.1‑cp27‑none‑win_amd64.whl

after installed problem solved.

ref: http://www.pytables.org/usersguide/installation.html#binary-installation-windows

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.