我在Linux机器上编写了一个简单的Python脚本:#!/bin/python
import wget
wget.download("","/tmp)
这段代码运行得很好,从apache2服务器下载文件并保存到/tmp文件夹
接下来,我将位置从“/tmp”更改为“C:/”。我在我的Windows机器上安装了Python、pip、pyInstaller和wget模块。现在通过pyInstaller我想制作.exe文件,从服务器下载文件并保存到光盘C:/。
我以管理员身份运行命令:
^{pr2}$
输出:70 INFO: PyInstaller: 3.5
70 INFO: Python: 3.7.4
70 INFO: Platform: Windows-10-10.0.18362-SP0
70 INFO: wrote C:\test.spec
70 INFO: UPX is not available.
70 INFO: Extending PYTHONPATH with paths
['C:\\', 'C:\\']
70 INFO: checking Analysis
70 INFO: Building Analysis because Analysis-00.toc is non existent
70 INFO: Initializing module dependency graph...
91 INFO: Initializing module graph hooks...
184 INFO: Analyzing base_library.zip ...
7545 INFO: running Analysis Analysis-00.toc
7559 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\tester\appdata\local\programs\python\python37-32\python.exe
7919 INFO: Caching module hooks...
8039 INFO: Analyzing C:\test.py
8620 INFO: Loading module hooks...
8620 INFO: Loading module hook "hook-encodings.py"...
8774 INFO: Loading module hook "hook-pydoc.py"...
8807 INFO: Loading module hook "hook-xml.py"...
8983 INFO: Looking for ctypes DLLs
8983 INFO: Analyzing run-time hooks ...
8996 INFO: Looking for dynamic libraries
9720 INFO: Looking for eggs
9720 INFO: Using Python library c:\users\tester\appdata\local\programs\python\python37-32\python37.dll
9720 INFO: Found binding redirects:
[]
9728 INFO: Warnings written to C:\build\test\warn-test.txt
9794 INFO: Graph cross-reference written to C:\build\test\xref-test.html
9855 INFO: checking PYZ
9855 INFO: Building PYZ because PYZ-00.toc is non existent
9855 INFO: Building PYZ (ZlibArchive) C:\build\test\PYZ-00.pyz
10478 INFO: Building PYZ (ZlibArchive) C:\build\test\PYZ-00.pyz completed successfully.
10511 INFO: checking PKG
10511 INFO: Building PKG because PKG-00.toc is non existent
10511 INFO: Building PKG (CArchive) PKG-00.pkg
10531 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
10543 INFO: Bootloader c:\users\tester\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
10543 INFO: checking EXE
10543 INFO: Building EXE because EXE-00.toc is non existent
10543 INFO: Building EXE from EXE-00.toc
10543 INFO: Appending archive to EXE C:\build\test\test.exe
10616 INFO: Building EXE from EXE-00.toc completed successfully.
10616 INFO: checking COLLECT
10636 INFO: Building COLLECT because COLLECT-00.toc is non existent
10636 INFO: Building COLLECT COLLECT-00.toc
11835 INFO: Building COLLECT COLLECT-00.toc completed successfully.
当我运行编译后的脚本时,C:/中没有显示任何内容
问题是:我是错过了什么,还是做错了什么?我应该手动向pyInstaller命令添加wget模块吗?或者我只是不了解pyInstaller文档,而且无法在Windows.exe文件中使用外部模块?在