【问题标题】:How to compile and package a python file into an execution file under windows 64bitwindows 64bit下如何将python文件编译打包成执行文件
【发布时间】:2016-09-07 07:54:29
【问题描述】:

最近开始用theano做一些基本的BP网络。安装了theano,我的基于theano的网络在我的PC上运行良好。 为了在同事之间分享我的代码,我正在寻找一种方法,将theano python文件打包成一个执行文件,可以在没有python环境的windows下运行。

我正在尝试 py2exe 来完成打包工作,我发现打包后的 exe 只能在我的电脑上运行。当我将 exe 复制到没有 python 的其他 PC 时,它不起作用。只有警告信息是:

“WARNING (theano.configdefaults): g++ not detected ! 

Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.”

我的工作环境是: Win10 64bit + Anaconda2

谁能给我一些建议,让我根据theano python文件生成exe文件?

非常感谢。

【问题讨论】:

标签: python package exe theano py2exe


【解决方案1】:

试试PyInstaller

PyInstaller 是一个在 Windows、Linux、Mac OS X、FreeBSD、Solaris 和 AIX 下将 Python 程序冻结(打包)成独立可执行文件的程序。

【讨论】:

    【解决方案2】:

    我使用cxFreeze 将我的Python 脚本转换为.exe 它是一个非常好的模块。你可以看到它的工作here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-23
      • 2015-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-10
      • 2011-02-26
      • 1970-01-01
      相关资源
      最近更新 更多