2

我正在尝试在 jupyter notebook 中使用 CAMB,所以我使用了CAMB 演示代码的第一部分:

    %matplotlib inline
    import sys, platform, os
    from matplotlib import pyplot as plt
    import numpy as np
    #uncomment this if you are running remotely and want to keep in synch with repo changes
    #if platform.system()!='Windows':
    #    !cd $HOME/git/camb; git pull github master; git log -1
    print('Using CAMB installed at '+ os.path.realpath(os.path.join(os.getcwd(),'..')))
    sys.path.insert(0,os.path.realpath(os.path.join(os.getcwd(),'..')))
    import camb
    from camb import model, initialpower

但我得到了这个错误:

Using CAMB installed at /home/xoca/Desktop

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-66d4d2b00c4a> in <module>()
      8 print('Using CAMB installed at '+ os.path.realpath(os.path.join(os.getcwd(),'..')))
      9 sys.path.insert(0,os.path.realpath(os.path.join(os.getcwd(),'..')))
---> 10 import camb
     11 from camb import model, initialpower

/home/xoca/.local/lib/python2.7/site-packages/camb/__init__.py in <module>()
     10 __version__ = "0.1.2"
     11 
---> 12 from .baseconfig import dll_import
     13 from .camb import CAMBdata, MatterTransferData, get_results, get_transfer_functions, get_background, \
     14     get_age, get_zre_from_tau, set_z_outputs, set_feedback_level, set_params, get_matter_power_interpolator

/home/xoca/.local/lib/python2.7/site-packages/camb/baseconfig.py in <module>()
     33     if not osp.isfile(CAMBL): sys.exit(
     34         '%s does not exist.\nPlease remove any old installation and install again.' % DLLNAME)
---> 35     camblib = ctypes.LibraryLoader(ifort_gfortran_loader).LoadLibrary(CAMBL)
     36 # camblib = ctypes.cdll.LoadLibrary(CAMBL)
     37 else:

/home/xoca/anaconda2/lib/python2.7/ctypes/__init__.pyc in LoadLibrary(self, name)
    438 
    439     def LoadLibrary(self, name):
--> 440         return self._dlltype(name)
    441 
    442 cdll = LibraryLoader(CDLL)

/home/xoca/anaconda2/lib/python2.7/ctypes/__init__.pyc in __init__(self, name, mode, handle, use_errno, use_last_error)
    360 
    361         if handle is None:
--> 362             self._handle = _dlopen(self._name, mode)
    363         else:
    364             self._handle = handle

OSError: /home/xoca/anaconda2/bin/../lib/libgomp.so.1: version `GOMP_4.0' not found (required by /home/xoca/.local/lib/python2.7/site-packages/camb/camblib.so)

所以,我不知道发生了什么。我试图找到“GOMP 4.0”包,但没有找到。那么,有人可以帮我解决这个问题吗?

4

0 回答 0