简体   繁体   English

py2exe是否包含导入的模块?

[英]Does py2exe include imported modules?

I wrote a small script from which I want to try to compile exe and run on another computer. 我写了一个小脚本,尝试从中编译exe并在另一台计算机上运行。 So the main question is about imported modules in the script. 因此,主要问题是关于脚本中导入的模块。 Most of them is standard of python 3.4, but few ones (suds, lxml) is installed by me. 它们大多数是python 3.4的标准,但是我安装的却很少(suds,lxml)。 Do i need to install python and those modules on other machine or all needed files will be included in compiled distribution? 我是否需要在其他计算机上安装python和那些模块,否则所有需要的文件都将包含在编译的发行版中?

From http://www.py2exe.org/old/ : http://www.py2exe.org/old/

py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring a python installation. py2exe是Python distutils扩展,可将python脚本转换为可执行的Windows程序,无需安装python即可运行。

UPDATE UPDATE

From http://www.py2exe.org/old/#how-does-it-work http://www.py2exe.org/old/#how-does-it-work

py2exe uses python's modulefinder to examine your script and find all python and extension modules needed to run it. py2exe使用python的modulefinder检查您的脚本并找到运行它所需的所有python和扩展模块。 Pure python modules are compiled into .pyc or .pyo files in a temporary directory. 纯python模块在临时目录中编译成.pyc或.pyo文件。

So you don't have to worry about the modules - be they standard or installed by you. 因此,您不必担心模块-是标准模块还是由您安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM