python matlab库_MATLAB为什么无法导入此python库?

我想在MATLAB中使用http://www.losonczylab.org/sima/1.2/.

我可以从python正常运行.

我可以在MATLAB中导入示例依赖项.

$/opt/local/bin/python Python 2.7.9 (default, Dec 13 2014, 15:13:49) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from sima import sequence >>> sequence >>> from sima import ImagingDataset >>> ImagingDataset

在MATLAB中:

>> pyversion /opt/local/bin/python >> pyversion version: "2.7" executable: "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Cont..." library: "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib" home: "/opt/local/Library/Frameworks/Python.framework/Versions/2.7" isloaded: 0 >> import py.picos.tools.available_solvers >> available_solvers ans = Python list with no properties. ["cvxopt", "mosek7"] >> import py.numpy.empty >> empty(0) ans = Python ndarray with properties: T: [1x1 py.numpy.ndarray] base: [1x1 py.NoneType] ctypes: [1x1 py.numpy.core._internal._ctypes] data: [1x0 py.buffer] dtype: [1x1 py.numpy.dtype] flags: [1x1 py.numpy.flagsobj] flat: [1x1 py.numpy.flatiter] imag: [1x1 py.numpy.ndarray] itemsize: 8 nbytes: 0 ndim: 1 real: [1x1 py.numpy.ndarray] shape: [1x1 py.tuple] size: 0 strides: [1x1 py.tuple] [] >> import py.sima.sequence Error using import Import argument "py.sima.sequence" cannot be found or cannot be imported. >> import py.sima.Sequence Error using import Import argument "py.sima.Sequence" cannot be found or cannot be imported. >> import py.sima.Sequence.create Error using import Import argument "py.sima.Sequence.create" cannot be found or cannot be imported. >> import py.sima.sequence.create Error using import Import argument "py.sima.sequence.create" cannot be found or cannot be imported. >> import py.sima.sequence Error using import Import argument "py.sima.sequence" cannot be found or cannot be imported. >> import py.sima.Sequence Error using import Import argument "py.sima.Sequence" cannot be found or cannot be imported. >> import py.sima.ImagingDataset Error using import Import argument "py.sima.ImagingDataset" cannot be found or cannot be imported. >> import py.sima.imagingdataset Error using import Import argument "py.sima.imagingdataset" cannot be found or cannot be imported. >> import py.sima Error using import Import argument "py.sima" cannot be found or cannot be imported.

我怎么知道为什么不能导入sima?

sima正在前进:

>> pp = py.pprint.PrettyPrinterpp = Python PrettyPrinter with no properties. >> pp.pprint(py.sys.path)["", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload", "/Users/eflister/Library/Python/2.7/lib/python/site-packages", "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages"]

我想出了以下乏味的方法来查找问题的输入-有更好的方法吗?

>定义模块为http://www.mathworks.com/help/matlab/matlab_external/call-user-defined-custom-module.html

>从MATLAB无法加载的库中的源文件复制导入

>注释掉可疑的导入,直到对模块的MATLAB调用成功

>重命名模块并重复(一旦成功加载,MATLAB必须重新启动以查看新更改)

我只需要这样做29次就可以隔离出以下有问题的sima输入.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值