asdf-format / asdf

ASDF (Advanced Scientific Data Format) is a next generation interchange format for scientific data
http://asdf.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
526 stars 58 forks source link

Python 3.5 ImportError for pyasdf.compat.user_collections_py3 #187

Closed cdeil closed 8 years ago

cdeil commented 8 years ago

I'm getting this error for Python 3.5:

$ pip install asdf
$ python -c 'import pyasdf; pyasdf.test()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/deil/Library/Python/3.5/lib/python/site-packages/pyasdf/__init__.py", line 37, in <module>
    from .asdf import AsdfFile
  File "/Users/deil/Library/Python/3.5/lib/python/site-packages/pyasdf/asdf.py", line 15, in <module>
    from . import block
  File "/Users/deil/Library/Python/3.5/lib/python/site-packages/pyasdf/block.py", line 23, in <module>
    from .compat.numpycompat import NUMPY_LT_1_7
  File "/Users/deil/Library/Python/3.5/lib/python/site-packages/pyasdf/compat/__init__.py", line 13, in <module>
    from .user_collections_py3.UserDict import UserDict
ImportError: No module named 'pyasdf.compat.user_collections_py3'
embray commented 8 years ago

@bernie-simon had this happen once too. I'm not sure why.

embray commented 8 years ago

Looks like the user_collections_py3 package is completely missing from the source tarball on pypi. Strange.

embray commented 8 years ago

I understand now. It seems that the astropy-helpers get_package_info() utility automatically excludes packages with _py2 in the name if being run with Python 3, and vise-versa. What's worse is that it does so quietly, which I don't like.

These compat packages need to be explicitly specified in MANIFEST.in to ensure that they are included in source releases.

embray commented 8 years ago

I'll have a new release up in a bit with the fix.

bsipocz commented 8 years ago

@embray - It looks like that this issue still comes up with v1.0.1:

https://travis-ci.org/astropy/conda-builder-affiliated/jobs/101299384#L1529

embray commented 8 years ago

@bsipocz That must be a problem with the conda package then because the source distribution is not missing that module.