在修复我的PATH变量以使一些库安装工作之后,我发现我的IPython Notebook(Ubuntu 14.04上的Enthought Canopy)在使用%matplotlib magic命令时抛出以下错误:
ImportError: /home/joe/Enthought/Canopy_64bit/User/bin/../lib/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3)
我在尝试安装python-bio-formats,pims和pylibtiff时也遇到了这个错误。
同样,任何想法都值得赞赏。
编辑:完整错误追溯:
ImportError Traceback (most recent call last)
<ipython-input-1-3042faeb62d7> in <module>()
----> 1 get_ipython().magic(u'matplotlib')
2 #import cv2
3 #import numpy as np
4 #import pandas as pd
5 #import os
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2203 magic_name, _, magic_arg_s = arg_s.partition(' ')
2204 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2205 return self.run_line_magic(magic_name, magic_arg_s)
2206
2207 #-------------------------------------------------------------------------
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2124 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2125 with self.builtin_trap:
-> 2126 result = fn(*args,**kwargs)
2127 return result
2128
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/magics/pylab.pyc in matplotlib(self, line)
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/magics/pylab.pyc in matplotlib(self, line)
78 """
79 args = magic_arguments.parse_argstring(self.matplotlib, line)
---> 80 gui, backend = self.shell.enable_matplotlib(args.gui)
81 self._show_matplotlib_backend(args.gui, backend)
82
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in enable_matplotlib(self, gui)
2929 """
2930 from IPython.core import pylabtools as pt
-> 2931 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)
2932
2933 if gui != 'inline':
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/pylabtools.pyc in find_gui_and_backend(gui, gui_select)
250 """
251
--> 252 import matplotlib
253
254 if gui and gui != 'auto':
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/__init__.py in <module>()
177 # cbook must import matplotlib only within function
178 # definitions, so it is safe to import from it here.
--> 179 from matplotlib.cbook import is_string_like
180 from matplotlib.compat import subprocess
181
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/cbook.py in <module>()
30 from weakref import ref, WeakKeyDictionary
31
---> 32 import numpy as np
33 import numpy.ma as ma
34
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/__init__.pyc in <module>()
168 return loader(*packages, **options)
169
--> 170 from . import add_newdocs
171 __all__ = ['add_newdocs',
172 'ModuleDeprecationWarning',
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/add_newdocs.py in <module>()
11 from __future__ import division, absolute_import, print_function
12
---> 13 from numpy.lib import add_newdoc
14
15 ###############################################################################
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>()
16
17 from . import scimath as emath
---> 18 from .polynomial import *
19 #import convertcode
20 from .utils import *
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/polynomial.py in <module>()
17 from numpy.lib.function_base import trim_zeros, sort_complex
18 from numpy.lib.type_check import iscomplex, real, imag
---> 19 from numpy.linalg import eigvals, lstsq, inv
20
21 class RankWarning(UserWarning):
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/linalg/__init__.py in <module>()
49 from .info import __doc__
50
---> 51 from .linalg import *
52
53 from numpy.testing import Tester
/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/linalg/linalg.py in <module>()
27 )
28 from numpy.lib import triu, asfarray
---> 29 from numpy.linalg import lapack_lite, _umath_linalg
30 from numpy.matrixlib.defmatrix import matrix_power
31 from numpy.compat import asbytes
ImportError: /home/joe/Enthought/Canopy_64bit/User/bin/../lib/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3)
完整路径(来自echo $ PATH):
/home/joe/Enthought/Canopy_64bit/User/bin:
/home/joe/Enthought/Canopy_64bit/User/bin:
/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games
sys.path中:
['', '/home/joe/Enthought/Canopy_64bit/User/src/svn',
'/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pims',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python27.zip',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/plat-linux2',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/lib-tk',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/lib-old',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/lib-dynload',
'/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages',
'/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PIL',
'/home/joe/opencv-2.4.9',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/site-packages']
答案 0 :(得分:0)
我可以按照此处列出的步骤(具体来说,步骤3-5)解决此错误:https://support.enthought.com/entries/23580651-Uninstalling-and-resetting-Canopy。
当使用pip(命令:pip install --upgrade http://github.com/soft-matter/pims/zipball/master
)重新尝试安装pims(https://github.com/soft-matter/pims)时,可以复制该问题。奇。
我在尝试通过其setup.py脚本安装pylibtiff时遇到问题,但我会在另一个SO帖子中发布,进一步详细说明错误。
答案 1 :(得分:0)
这可能会迟到,但您可以尝试以下主题
https://github.com/ContinuumIO/anaconda-issues/issues/686
特别是Zarhid的那个:
conda remove libgfortran
conda install libgcc --force
用pip替换conda并相应地修改。为我工作