如何在macOS上运行Nuitka

时间:2018-01-31 11:06:50

标签: python dylib install-name-tool nuitka

我试图在一个非常基本的Python脚本上运行Nuitka,只是为了测试它。 不幸的是,我收到一个我无法理解的错误。

$ nuitka-run dice_test.py                                                                                                                 
Nuitka:WARNING:The version '3.6' is not currently supported. Expect problems.
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: more than one input file specified (libpython3.6m.dylib and --change)
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input
Error, call to 'install_name_tool' to fix Python library path failed.

这里有什么问题?怎么解决?

一些额外信息:

# xxx @ yyy in ~/scripts on git:master x [11:53:39] C:1
$ locate libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib
/Users/xxx/homebrew/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.dylib
/Users/xxx/miniconda3/lib/libpython3.6m.dylib
/Users/xxx/miniconda3/pkgs/python-3.6.3-h5ce8c04_4/lib/libpython3.6m.dylib
/Users/xxx/miniconda3/pkgs/python-3.6.3-h6804ab2_0/lib/libpython3.6m.dylib

# xxx @ yyy in ~/scripts on git:master x [11:53:49] 
$ which nuitka
/Users/xxx/miniconda3/bin/nuitka

# xxx @ yyy in ~ [12:16:56] 
$ which python
/Users/xxx/miniconda3/bin/python

# xxx @ yyy in ~ [12:17:05] 
$ python --version
Python 3.6.3 :: Anaconda, Inc.

我试过了install_name_tool -id "@loader_path/Users/xxx/miniconda3/lib/libpython3.6m.dylib" libpython3.6m.dylib,但它没有用。

1 个答案:

答案 0 :(得分:0)

您是否尝试过裸 Python。以我的拙见,Nuitka 似乎难以处理像 Anaconda 这样的虚拟环境。