python没报错但不出图_Conda / Python:导入错误 – 仅在jupyter笔记本中找不到图像...

我在一台jupyter笔记本中输入了scipy.io失败.令人困惑的部分是我在i

Python终端中没有得到相同或任何错误,但我在标准的Python终端中.这让我想到,不知怎的,我的jupyter会话使用的是不同于其他会话的链接路径,但是我还没有弄清楚如何接近/调试/修复它.

我的问题:

>有没有其他人遇到这个或类似的东西?

> jupyter不应该在终端和笔记本会话中使用相同的库路径吗?

>我在下面的conda信息中包含了我的路径设置.任何人都会有关于如何/为何发生这种情况的事情吗?

在IPython终端中

$ipython

Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12)

Type "copyright", "credits" or "license" for more information.

IPython 4.2.0 -- An enhanced Interactive Python.

? -> Introduction and overview of IPython's features.

%quickref -> Quick reference.

help -> Python's own help system.

object? -> Details about 'object', use 'object??' for extra details.

In [1]: import sys

In [2]: print(sys.executable)

/Users/jhamman/anaconda/bin/python

In [3]: import scipy.io

In [4]:

在标准Python解释器中

$python

Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12)

[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import sys

>>> print(sys.executable)

/Users/jhamman/anaconda/bin/python

>>> import scipy.io

Traceback (most recent call last):

File "", line 1, in

File "/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/__init__.py", line 97, in

from .matlab import loadmat, savemat, whosmat, byteordercodes

File "/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/matlab/__init__.py", line 13, in

from .mio import loadmat, savemat, whosmat

File "/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/matlab/mio.py", line 12, in

from .miobase import get_matfile_version, docfiller

File "/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/matlab/miobase.py", line 22, in

from scipy.misc import doccer

File "/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/misc/__init__.py", line 51, in

from scipy.special import comb, factorial, factorial2, factorialk

File "/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/special/__init__.py", line 636, in

from ._ufuncs import *

ImportError: dlopen(/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/special/_ufuncs.so, 2): Library not loaded: /usr/local/lib/libgcc_s.1.dylib

Referenced from: /Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/special/_ufuncs.so

Reason: image not found

在Jupyter笔记本中

import sys

print(sys.executable)

/Users/jhamman/anaconda/bin/python

import scipy.io

ImportError Traceback (most recent call last)

in ()

----> 1 import scipy.io

/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/__init__.py in ()

95

96 # matfile read and write

---> 97 from .matlab import loadmat, savemat, whosmat, byteordercodes

98

99 # netCDF file support

/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/matlab/__init__.py in ()

11

12 # Matlab file read and write utilities

---> 13 from .mio import loadmat, savemat, whosmat

14 from . import byteordercodes

15

/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/matlab/mio.py in ()

10 from scipy._lib.six import string_types

11

---> 12 from .miobase import get_matfile_version, docfiller

13 from .mio4 import MatFile4Reader, MatFile4Writer

14 from .mio5 import MatFile5Reader, MatFile5Writer

/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/io/matlab/miobase.py in ()

20 byteord = ord

21

---> 22 from scipy.misc import doccer

23

24 from . import byteordercodes as boc

/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/misc/__init__.py in ()

49 from .common import *

50 from numpy import who, source, info as _info

---> 51 from scipy.special import comb, factorial, factorial2, factorialk

52

53 import sys

/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/special/__init__.py in ()

634 from __future__ import division, print_function, absolute_import

635

--> 636 from ._ufuncs import *

637

638 from .basic import *

ImportError: dlopen(/Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/special/_ufuncs.so, 2): Library not loaded: /usr/local/lib/libgcc_s.1.dylib

Referenced from: /Users/jhamman/anaconda/lib/python3.5/site-packages/scipy/special/_ufuncs.so

Reason: image not found

最后一点,这是来自conda信息的转储:

$conda info -a

Current conda install:

platform : osx-64

conda version : 4.1.11

conda-env version : 2.5.2

conda-build version : 1.21.3

python version : 3.5.2.final.0

requests version : 2.10.0

root environment : /Users/jhamman/anaconda (writable)

default environment : /Users/jhamman/anaconda

envs directories : /Users/jhamman/anaconda/envs

package cache : /Users/jhamman/anaconda/pkgs

channel URLs : https://repo.continuum.io/pkgs/free/osx-64/

https://repo.continuum.io/pkgs/free/noarch/

https://repo.continuum.io/pkgs/pro/osx-64/

https://repo.continuum.io/pkgs/pro/noarch/

config file : None

offline mode : False

is foreign system : False

# conda environments:

#

root * /Users/jhamman/anaconda

sys.version: 3.5.2 |Anaconda custom (x86_64)| (defaul...

sys.prefix: /Users/jhamman/anaconda

sys.executable: /Users/jhamman/anaconda/bin/python3

conda location: /Users/jhamman/anaconda/lib/python3.5/site-packages/conda

conda-build: /Users/jhamman/anaconda/bin/conda-build

conda-convert: /Users/jhamman/anaconda/bin/conda-convert

conda-develop: /Users/jhamman/anaconda/bin/conda-develop

conda-env: /Users/jhamman/anaconda/bin/conda-env

conda-index: /Users/jhamman/anaconda/bin/conda-index

conda-inspect: /Users/jhamman/anaconda/bin/conda-inspect

conda-metapackage: /Users/jhamman/anaconda/bin/conda-metapackage

conda-pipbuild: /Users/jhamman/anaconda/bin/conda-pipbuild

conda-render: /Users/jhamman/anaconda/bin/conda-render

conda-server: /Users/jhamman/anaconda/bin/conda-server

conda-sign: /Users/jhamman/anaconda/bin/conda-sign

conda-skeleton: /Users/jhamman/anaconda/bin/conda-skeleton

user site dirs:

CIO_TEST:

CONDA_DEFAULT_ENV:

CONDA_ENVS_PATH:

DYLD_LIBRARY_PATH:

PATH: /Users/jhamman/anaconda/bin:/opt/local/bin:/opt/local/sbin

PYTHONHOME:

PYTHONPATH:

最佳答案 这似乎是conda构建的一个错误:

一位评论员(@stuarteberg)就此问题表示:

The new latest scipy version (0.18.0) also has the same problem. In case it’s somehow useful, the conda-forge package for scipy is not broken in this way.

@andykitchen发现将scipy降级到0.17.0修复了问题:

Yup can confirm I had this problem as well, the fix for me was to also to downgrade to 0.17.0

conda install --force scipy=0.17.0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值