Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed cPickle import in python3 #365

Closed
mapa17 opened this issue Jul 11, 2014 · 4 comments
Closed

failed cPickle import in python3 #365

mapa17 opened this issue Jul 11, 2014 · 4 comments
Labels
Milestone

Comments

@mapa17
Copy link

mapa17 commented Jul 11, 2014

I try to use PyTables 3.1.1 in a python 3.4.1 environment. Importing tables fails

In [1]: import tables
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-389ecae14f10> in <module>()
----> 1 import tables

/work/projects/vEnv/lib/python3.4/site-packages/tables/__init__.py in <module>()
     80 
     81 # Necessary imports to get versions stored on the cython extension
---> 82 from tables.utilsextension import (
     83     get_pytables_version, get_hdf5_version, blosc_compressor_list,
     84     blosc_compcode_to_compname_ as blosc_compcode_to_compname,

/work/projects/IPyBooks/utilsextension.pyx in init tables.utilsextension (tables/utilsextension.c:15600)()

/work/projects/vEnv/lib/python3.4/site-packages/tables/description.py in <module>()
     22 import numpy
     23 
---> 24 from tables import atom
     25 from tables.path import check_name_validity
     26 

/work/projects/vEnv/lib/python3.4/site-packages/tables/atom.py in <module>()
     18 import sys
     19 import inspect
---> 20 import cPickle
     21 
     22 import numpy

ImportError: No module named 'cPickle'

As i understand in python3 pickle should be used instead of cPickle. Any suggestions?

@avalentino
Copy link
Member

Hi @mapa17, this is very strange.
How did you installed pytables?

@mapa17
Copy link
Author

mapa17 commented Jul 11, 2014

Hi @avalentino

as described on the homepage i used
pip install git+https://github.com/PyTables/PyTables.git@v.3.1.1#egg=tables

What i don't understand is how this could work on any python3 installation? Should atom.py no be imported in a python3 installation?

@avalentino
Copy link
Member

@mapa17, the setup script translates (at least it should do it) the python2 sources into python3 sources using the 2to3 tool before building and installing them.

I tried to reproduce the issue in a fresh virtualenv but I was not able to reproduce it.
All works correctly for me.

Is it possible that your virtualenv is somewhat corrupted?

What happens if you try to use pytables from the standard python interpreter (not ipython)?

Something like the following:

$ python -c "import tables as tb; print(tb.__version__); print(tb.__file__)"
3.1.1
/home/antonio/projects/venvs/p3/lib/python3.4/site-packages/tables/__init__.py

@mapa17
Copy link
Author

mapa17 commented Jul 11, 2014

@avalentino I think you where correct. There must have been something wrong with my vEnv setup.

I uninstalled the package and installed it again; now things work fine! If i remember correctly during the first installation of the package compilation failed because of some missing dependency. I installed all needed packages and than rerun the compilation process on the same pip build folder. Maybe that was the reason.

Thx for you help!

@mapa17 mapa17 closed this as completed Jul 11, 2014
@avalentino avalentino added this to the 3.2 milestone Jul 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants