0
我目前无法使用Cython嵌入功能。二进制编译正常,并且otool -L embedded
返回以下结果。嵌入在Mac上的python ModuleNotFoundError:没有名为“编码”的模块
embedded:
@rpath/libpython3.6m.dylib (compatibility version 3.6.0, current version 3.6.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1349.8.0)
这是我跑的命令。任何想法为什么这不起作用?当我想创建一个Cython模块时,使用setup.py的Cython可以正常工作,也就是说我能够使用Python导入Cython模块。
$ make
gcc -c embedded.c -I/Users/$USER/miniconda3/include/python3.6m -I/Users/$USER/miniconda3/include/python3.6m
gcc -o embedded embedded.o -L/Users/$USER/miniconda3/lib -L/Users/$USER/miniconda3/lib/python3.6/config-3.6m-darwin -lpython3.6m -ldl -framework CoreFoundation -Wl,-stack_size,1000000 -framework CoreFoundation
$ ./embedded
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x000000010f8113c0 (most recent call first):
[1] 32931 abort ./embedded
建议?