在Windows上使用Nuitka编译hello-world.py时遇到问题.
我使用的命令是:
nuitka --standalone --portable --remove-output --recurse-all --python-version=3.4 hello_world.py
Run Code Online (Sandbox Code Playgroud)
错误是:
WindowsError: [Error 2] The system cannot find the file specified:
File "C:\Users\win_user\Anaconda3\Lib\site-packages\nuitka\build\SingleExe.scons", line 866:
shell = False
File "c:\Python27\lib\subprocess.py", line 709:
errread, errwrite)
File "c:\Python27\lib\subprocess.py", line 957:
startupinfo)
Run Code Online (Sandbox Code Playgroud)
相同的代码在Linux上编译和运行正常.相同的代码在Windows上的解释器中运行良好.
错误消息中提到的文件确实存在.有什么建议?
使用Win7.Python 3.4(Anaconda x64).使用MinGW.
谁能说出如何检测代码是否在Nuitka创建的exe或正常的python解释器中运行?
我认为我理想上希望一个“ is_nuitka ”标志在编译时设置为True,并且在不编译时根本不存在。
然后可以使用如下代码:
if '__is_nuitka__' in locals() or '__is_nuitka__' in globals():
print('debug info: running in nuitka mode')
Run Code Online (Sandbox Code Playgroud)
有什么建议么?有这样的东西吗?还有其他方法吗?