erykoff / redmapper

The redMaPPer Cluster Finder
Apache License 2.0
22 stars 8 forks source link

import error #40

Open gwanu5 opened 5 years ago

gwanu5 commented 5 years ago

Hey there,

I'm trying to install and use redmapper on Ubuntu 18.04 LTS. System is updated and all dependencies have been installed but when i try to import the code this is the error:

ImportError Traceback (most recent call last)

in ----> 1 import redmapper ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/__init__.py in 11 version = __version__ 12 ---> 13 from . import calibration 14 from . import pipeline 15 from . import redmagic ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/calibration/__init__.py in 1 from __future__ import division, absolute_import, print_function 2 ----> 3 from .selectspecred import SelectSpecRedGalaxies 4 from .redsequencecal import RedSequenceCalibrator 5 from .centeringcal import WcenCalibrator ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/calibration/selectspecred.py in 11 #from pkg_resources import resource_exists 12 ---> 13 from ..configuration import Configuration 14 from ..fitters import MedZFitter, RedSequenceFitter, EcgmmFitter 15 from ..galaxy import GalaxyCatalog ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/configuration.py in 15 import os 16 ---> 17 from .cluster import cluster_dtype_base, member_dtype_base 18 from .utilities import Logger 19 from ._version import __version__ ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/cluster.py in 20 from .utilities import chisq_pdf, calc_theta_i, MStar, schechter_pdf, nfw_pdf 21 from .mask import HPMask ---> 22 from .redsequence import RedSequenceColorPar 23 from esutil.cosmology import Cosmo 24 from .galaxy import GalaxyCatalog ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/redsequence.py in 14 from scipy import interpolate 15 ---> 16 from .chisq_dist import compute_chisq 17 from .catalog import Catalog 18 from .utilities import CubicSpline, MStar ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/chisq_dist/__init__.py in ----> 1 from . import chisq_dist_lib 2 from .chisq_dist_lib import compute_chisq ~/Environment/reduc/lib/python3.6/site-packages/redmapper-0.5.1-py3.6-linux-x86_64.egg/redmapper/chisq_dist/chisq_dist_lib.py in 6 7 import numpy as np ----> 8 from . import _chisq_dist_pywrap 9 10 #class ChisqDist(object): ImportError: /usr/lib/x86_64-linux-gnu/libgsl.so.23: undefined symbol: cblas_ctrmv **Any suggestions would be appreciated.**
erykoff commented 5 years ago

Hmm. I don't have an Ubuntu 18.04 installation myself, but I just added it on a branch to the travis matrix and there weren't any problems. See https://github.com/erykoff/redmapper/pull/41 . Do you have both gsl-bin and libgsl0-dev packages installed?

gwanu5 commented 5 years ago

I've uninstalled Ubuntu and installed Fedora 31 instead. Just to see whether the installation goes right. Again, installed python 3.7.5, then the required dependencies. This time I get:

ImportError Traceback (most recent call last)

in ----> 1 import redmapper ~/tmp/redmapper/redmapper/__init__.py in 11 version = __version__ 12 ---> 13 from . import calibration 14 from . import pipeline 15 from . import redmagic ~/tmp/redmapper/redmapper/calibration/__init__.py in 1 from __future__ import division, absolute_import, print_function 2 ----> 3 from .selectspecred import SelectSpecRedGalaxies 4 from .redsequencecal import RedSequenceCalibrator 5 from .centeringcal import WcenCalibrator ~/tmp/redmapper/redmapper/calibration/selectspecred.py in 11 #from pkg_resources import resource_exists 12 ---> 13 from ..configuration import Configuration 14 from ..fitters import MedZFitter, RedSequenceFitter, EcgmmFitter 15 from ..galaxy import GalaxyCatalog ~/tmp/redmapper/redmapper/configuration.py in 15 import os 16 ---> 17 from .cluster import cluster_dtype_base, member_dtype_base 18 from .utilities import Logger 19 from ._version import __version__ ~/tmp/redmapper/redmapper/cluster.py in 16 import copy 17 ---> 18 from .solver_nfw import Solver 19 from .catalog import Catalog, Entry 20 from .utilities import chisq_pdf, calc_theta_i, MStar, schechter_pdf, nfw_pdf ~/tmp/redmapper/redmapper/solver_nfw/__init__.py in ----> 1 from . import solver_nfw_lib 2 from .solver_nfw_lib import Solver ~/tmp/redmapper/redmapper/solver_nfw/solver_nfw_lib.py in 6 7 import numpy as np ----> 8 from . import _solver_nfw_pywrap 9 10 class Solver(object): ImportError: cannot import name '_solver_nfw_pywrap' from 'redmapper.solver_nfw' (/home/dogan/tmp/redmapper/redmapper/solver_nfw/__init__.py) **I need to install this asap and start learning the code but i can't start my studies because of these errors. What would you suggest ? I also can't find any solutions online...**
erykoff commented 5 years ago

How did you install it? You need to do python setup.py install to build the attached libraries, and then you cannot import from the redmapper directory directly because it will grab the local version (without libraries) and not the installed version. Did you go into the tests directory and run nosetests?

gwanu5 commented 5 years ago

Thanks for the reply. I've tried it again in my virtual-env and this time with a few extra package installs it worked !