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
建議?