科学网

 找回密码
  注册
Python调用C语言so
崔英博 2015-2-10 18:01
为提高 Python 程序运行效率,可以在 Python 中调用 C 代码。主要可以通过两种方式: (1)调用源文件 .c 中定义的函数 (2)调用编译成共享库的 so 文件 其中第一种方式可以通过 Cython 方便实现。 第二种方式可以通过 ctypes 实现,举例如下: 首先在 some.so 库文件中定义了 helloworld() 函数,其余步骤如下: ...
个人分类: python|7072 次阅读|没有评论
Anaconda 相关: undefined symbol: __log10_finite 解决
崔英博 2015-1-28 10:45
搞一个项目,需要使用 Python,Numpy 等 Python 库,而 Anaconda 是一个比较全的 Python 发行库,所以安装使用。 但是运行 Python 程序时报错: undefined symbol: __log10_finite undefined symbol: __pow_finite undefined symbol: __exp_finite 反复尝试后发现,是 Anaconda 中安装了 libm.so 库,与系统的 lib ...
个人分类: python|5927 次阅读|没有评论
Cython报错解决: #error Do not use this file, ...
崔英博 2014-11-17 09:49
Cython报错解决:#error Do not use this file, it is the result of a failed Cython compilation. 近来安装一个 python 程序需要用到 cython 编译器,python ./setup.py 过程中报错: #error Do not use this file, it is the result of a failed Cython compilation. 后来发现是 cyth ...
个人分类: python|8531 次阅读|没有评论

本页有 5 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-20 10:55

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部