uafgeotools / lts_array

Least trimmed squares array processing for infrasound and seismic data
MIT License
12 stars 6 forks source link

Import of lts_array fails under python 3.6 #10

Closed ibrewster closed 4 years ago

ibrewster commented 4 years ago

Under python 3.6, which is the newest readily available version on CentOS 7/8, attempting to import lts_array fails with the following error:

Python 3.6.8 (default, Apr  2 2020, 13:34:55) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lts_array
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lts_array/lts_array/__init__.py", line 1, in <module>
    from .fast_lts_array import fast_lts_array
  File "/lts_array/lts_array/fast_lts_array.py", line 6, in <module>
    import lts_array.flts_helper_array as fltsh
  File "/lts_array/lts_array/flts_helper_array.py", line 9, in <module>
    import lts_array.flts_helper_array as fltsh
AttributeError: module 'lts_array' has no attribute 'flts_helper_array'

Tested under both MacOS and Linux versions of Python. The same import command works properly under Python 3.7.x and 3.8.x

davidfee5 commented 4 years ago

I encountered the same problem on my mac when forcing the python version to 3.6.

davidfee5 commented 4 years ago

@jwbishop want to take a look at this? Seems pretty significant. Thanks.

jwbishop commented 4 years ago

For the record, this issue seems to have arisen due to the circular import. Confirmed to now work in Python 3.6.

A change occurred to imports in Python 3.7: "Circular imports involving absolute imports with binding a submodule to a name are now supported. (Contributed by Serhiy Storchaka in bpo-30024.)"

Good catch @liamtoney.