hail: AttributeError: module 'hail' has no attribute 'expr'

Relevant installed library versions: hail==0.2.18 numpy==1.17.0 pandas==0.23.4 pyspark==2.4.1 scipy==1.3.0

Code ran:

import hail as hl

Stack trace:
AttributeError: module 'hail' has no attribute 'expr'

AttributeError                            Traceback (most recent call last)
in engine
----> 1 import hail as hl

/home/cdsw/.local/lib/python3.6/site-packages/hail/__init__.py in <module>()
     29 from .expr import *
     30 from .genetics import *
---> 31 from .methods import *
     32 from . import genetics
     33 from . import methods

/home/cdsw/.local/lib/python3.6/site-packages/hail/methods/__init__.py in <module>()
      4     import_plink, read_matrix_table, read_table, get_vcf_metadata, import_vcf, import_vcfs, \
      5     index_bgen, import_matrix_table
----> 6 from .statgen import skat, identity_by_descent, impute_sex, \
      7     genetic_relatedness_matrix, realized_relationship_matrix, pca, \
      8     hwe_normalized_pca, pc_relate, split_multi, filter_alleles, filter_alleles_hts, \

/home/cdsw/.local/lib/python3.6/site-packages/hail/methods/statgen.py in <module>()
      5 
      6 import hail as hl
----> 7 import hail.expr.aggregators as agg
      8 from hail.expr.expressions import *
      9 from hail.expr.types import *

AttributeError: module 'hail' has no attribute 'expr'

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (11 by maintainers)

Most upvoted comments

Sent a PR over with the doc fix https://github.com/hail-is/hail/pull/7094. I did not claim it closes this issue as @pyousefi may be hitting another issue.

We’ve hit issues like this on some installations of Python, but I still have no idea what is the root cause inside Python. It looks like sometimes the submodule bar needs to be in the __all__ of foo to import like as import foo.bar.baz as bazz, and sometimes not.