popgenmethods / momi2

Infer demographic history with the Moran model
GNU General Public License v3.0
47 stars 11 forks source link

Error importing momi #31

Closed cae803 closed 4 years ago

cae803 commented 4 years ago

Hi. I'm trying to use momi2 according to the Installation guide and tutorial. When I import momi after installing using jupyter notebook, I get this error:


In [1]: import momi

ImportError Traceback (most recent call last)

in ----> 1 import momi ~/opt/anaconda3/envs/my-momi-env/lib/python3.6/site-packages/momi/__init__.py in 6 """ 7 from .compute_sfs import expected_sfs, expected_total_branch_len, expected_sfs_tensor_prod, expected_tmrca, expected_deme_tmrca ----> 8 from .likelihood import SfsLikelihoodSurface 9 from .confidence_region import ConfidenceRegion 10 from .data.configurations import build_config_list ~/opt/anaconda3/envs/my-momi-env/lib/python3.6/site-packages/momi/likelihood.py in 9 from .optimizers import _find_minimum, stochastic_opts, LoggingCallback 10 from .compute_sfs import expected_sfs, expected_total_branch_len, expected_heterozygosity ---> 11 from .demography import Demography 12 from .data.configurations import _ConfigList_Subset 13 from .data.sfs import Sfs ~/opt/anaconda3/envs/my-momi-env/lib/python3.6/site-packages/momi/demography.py in 9 from .compute_sfs import expected_total_branch_len 10 from .data.compressed_counts import _CompressedHashedCounts, _CompressedList ---> 11 from .data.snps import SnpAlleleCounts 12 from .util import memoize_instance 13 from .math_functions import ( ~/opt/anaconda3/envs/my-momi-env/lib/python3.6/site-packages/momi/data/snps.py in 7 import logging 8 import numpy as np ----> 9 import pysam 10 from cached_property import cached_property 11 from .configurations import ConfigList ~/opt/anaconda3/envs/my-momi-env/lib/python3.6/site-packages/pysam/__init__.py in 3 import sysconfig 4 ----> 5 from pysam.libchtslib import * 6 from pysam.libcsamtools import * 7 from pysam.libcbcftools import * ImportError: dlopen(/Users/kae/opt/anaconda3/envs/my-momi-env/lib/python3.6/site-packages/pysam/libchtslib.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libdeflate.so Referenced from: /Users/kae/opt/anaconda3/envs/my-momi-env/lib/libhts.2.dylib Reason: image not found ------------- the information of jupyter notebook is the following: ------------- Server Information: The version of the notebook server is: 6.0.1 The server is running on this version of Python: Python 3.6.7 | packaged by conda-forge | (default, Jul 2 2019, 02:07:37) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] Current Kernel Information: Python 3.6.7 | packaged by conda-forge | (default, Jul 2 2019, 02:07:37) Type 'copyright', 'credits' or 'license' for more information IPython 7.8.0 -- An enhanced Interactive Python. -------------- Would you tell me how to improve it? Thanks in advance.
jackkamm commented 4 years ago

It looks like something is wrong with your pysam installation. It might be due to this bug: https://github.com/bioconda/bioconda-recipes/issues/15415

Also -- I have just uploaded a new version of momi (2.1.18) on Python 3.7. Could you please try the new version in a fresh conda environment to see if the problem goes away.

cae803 commented 4 years ago

Thank you for your reply. I successfully installed and used momi!