简体   繁体   English

打包python脚本时pip安装的模块

[英]pip installed modules when packaging python scripts

I'm about to convert my python script into an executable with py2exe but I'm concerned that a few modules that I installed via pip (paramiko & xlrd) won't be included in that executable. 我将使用py2exe将python脚本转换为可执行文件,但我担心通过pip(paramiko和xlrd)安装的一些模块不会包含在该可执行文件中。 Does anyone know if those modules that are not from the standard library are included in the script when you move it over to .exe format? 当您将脚本移到.exe格式时,有人知道脚本中是否包含那些不是来自标准库的模块吗?

Yes. 是。 The paramiko folder - or any non-standard imported functionality - is located in the directory paramiko文件夹(或任何非标准导入的功能)位于目录中

C:\\path_to_your_script's_folder\\script_folder\\build\\bdist.win32\\winexe\\collect-2.7\\paramiko C:\\ path_to_your_script's_folder \\ script_folder \\建立\\ bdist.win32 \\ winexe \\收集-2.7 \\的paramiko

This folder holds all of the .pyc files that are associated to that imported file (in this case paramiko). 该文件夹包含与该导入文件关联的所有.pyc文件(在本例中为paramiko)。

Thanks to @Artyer and @Ofer Sadan for their help! 感谢@Artyer和@Ofer Sadan的帮助!

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

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