相关疑难解决方法(0)

导入Cython生成的.so文件时,这个ImportError的含义是什么?

我正在浏览Cython文档并构建每个示例应用程序.我有点困在使用C库.成功构建.so文件并尝试将其导入名为test.py的python文件后,将引发以下错误.

$ python3.2 test.py 
Traceback (most recent call last):
  File "test.py", line 12, in <module>
    from queue import Queue
ImportError: dlopen(/Users/jeremy/Development/labs/python/cython_lib_wrapper/queue.so, 2): Symbol not found: _queue_free
  Referenced from: /Users/jeremy/Development/labs/python/cython_lib_wrapper/queue.so
  Expected in: flat namespace
 in /Users/jeremy/Development/labs/python/cython_lib_wrapper/queue.so
Run Code Online (Sandbox Code Playgroud)

.so文件位于test.py文件旁边.所以,似乎应该找到它.这是在OSX 10.6上使用Python 3.2运行最新版本的Cython.

任何见解?

编辑 - 添加构建命令和输出

$ python3.2 setup.py build_ext --inplace
running build_ext
cythoning queue.pyx to queue.c
building 'queue' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c queue.c -o build/temp.macosx-10.6-intel-3.2/queue.o
    queue.c: In function ‘__pyx_f_5queue_5Queue_append’: …
Run Code Online (Sandbox Code Playgroud)

python shared-libraries cython

7
推荐指数
1
解决办法
4345
查看次数

标签 统计

cython ×1

python ×1

shared-libraries ×1