[Python] 纯文本查看 复制代码 from sanic import Sanic
from sanic.response import json
app = Sanic('test')
@app.route('/url2image')
async def InsertImage2ExcelFomUrl(request):
return json({'name':'tom'})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8989, debug=False)
打包
[C] 纯文本查看 复制代码 Microsoft Windows [版本 10.0.19045.3324]
(c) Microsoft Corporation。保留所有权利。
G:\项目文件\测试一下>pyinstaller -F test.py
1224 INFO: PyInstaller: 5.13.0
1224 INFO: Python: 3.11.2
1233 INFO: Platform: Windows-10-10.0.19045-SP0
1255 INFO: wrote G:\项目文件\测试一下\test.spec
1305 INFO: Extending PYTHONPATH with paths
['G:\\项目文件\\测试一下']
2038 INFO: checking Analysis
2038 INFO: Building Analysis because Analysis-00.toc is non existent
2038 INFO: Initializing module dependency graph...
2040 INFO: Caching module graph hooks...
2058 INFO: Analyzing base_library.zip ...
4257 INFO: Loading module hook 'hook-heapq.py' from 'D:\\Program Files\\Python311\\Lib\\site-packages\\PyInstaller\\hooks'...
4412 INFO: Loading module hook 'hook-encodings.py' from 'D:\\Program Files\\Python311\\Lib\\site-packages\\PyInstaller\\hooks'...
6476 INFO: Loading module hook 'hook-pickle.py' from 'D:\\Program Files\\Python311\\Lib\\site-packages\\PyInstaller\\hooks'...
8560 INFO: Caching module dependency graph...
8676 INFO: running Analysis Analysis-00.toc
8706 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by D:\Program Files\Python311\python.exe
8945 INFO: Analyzing G:\项目文件\测试一下\test.py
8947 INFO: Processing module hooks...
8956 INFO: Looking for ctypes DLLs
8966 INFO: Analyzing run-time hooks ...
8968 INFO: Including run-time hook 'D:\\Program Files\\Python311\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
8991 INFO: Looking for dynamic libraries
438 INFO: Extra DLL search directories (AddDllDirectory): []
438 INFO: Extra DLL search directories (PATH): ['D:\\Program Files\\Python311\\Scripts\\', 'D:\\Program Files\\Python311\\', 'D:\\zt\\bin\\git\\cmd', 'D:\\zt\\bin\\sliksvn', 'D:\\zt\\zbox\\nssm\\win32', 'C:\\Users\\tongy\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\', 'C:\\Users\\tongy\\AppData\\Local\\Programs\\Python\\Python37-32\\', 'C:\\Windows\\system32', 'C:\\Windows', 'C:\\Windows\\System32\\Wbem', 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\', 'C:\\Windows\\System32\\OpenSSH\\', 'C:\\Program Files\\Intel\\WiFi\\bin\\', 'C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\', 'C:\\ProgramData\\chocolatey\\bin', 'C:\\Users\\tongy\\AppData\\Local\\Microsoft\\WindowsApps', 'D:\\Program Files\\JetBrains\\PyCharm Community Edition 2022.3\\bin', 'D:\\Program Files\\Microsoft VS Code\\bin', 'C:\\Users\\tongy\\AppData\\Roaming\\npm', 'C:\\Program Files (x86)\\Tencent\\微信web开发者工具\\dll', 'D:\\Program Files\\platform-tools', 'D:\\gccc\\bin', 'D:\\gccc\\bin', 'D:\\Program Files\\nodejs\\', 'C:\\Program Files\\dotnet\\', 'C:\\Users\\tongy\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\', 'C:\\Users\\tongy\\AppData\\Local\\Programs\\Python\\Python37-32\\', 'C:\\Users\\tongy\\AppData\\Local\\Microsoft\\WindowsApps', 'D:\\Program Files\\JetBrains\\PyCharm Community Edition 2022.3\\bin', 'D:\\Program Files\\Microsoft VS Code\\bin', 'C:\\Program Files\\JetBrains\\WebStorm\\bin', 'C:\\Users\\tongy\\AppData\\Roaming\\npm']
9789 INFO: Looking for eggs
9790 INFO: Using Python library D:\Program Files\Python311\python311.dll
9790 INFO: Found binding redirects:
[]
9792 INFO: Warnings written to G:\项目文件\测试一下\build\test\warn-test.txt
9810 INFO: Graph cross-reference written to G:\项目文件\测试一下\build\test\xref-test.html
9861 INFO: checking PYZ
9861 INFO: Building PYZ because PYZ-00.toc is non existent
9862 INFO: Building PYZ (ZlibArchive) G:\项目文件\测试一下\build\test\PYZ-00.pyz
10151 INFO: Building PYZ (ZlibArchive) G:\项目文件\测试一下\build\test\PYZ-00.pyz completed successfully.
10156 INFO: checking PKG
10156 INFO: Building PKG because PKG-00.toc is non existent
10158 INFO: Building PKG (CArchive) test.pkg
12054 INFO: Building PKG (CArchive) test.pkg completed successfully.
12055 INFO: Bootloader D:\Program Files\Python311\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\run.exe
12055 INFO: checking EXE
12058 INFO: Building EXE because EXE-00.toc is non existent
12058 INFO: Building EXE from EXE-00.toc
12060 INFO: Copying bootloader EXE to G:\项目文件\测试一下\dist\test.exe.notanexecutable
12090 INFO: Copying icon to EXE
12100 INFO: Copying icons from ['D:\\Program Files\\Python311\\Lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
12102 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
12102 INFO: Writing RT_ICON 1 resource with 3752 bytes
12103 INFO: Writing RT_ICON 2 resource with 2216 bytes
12104 INFO: Writing RT_ICON 3 resource with 1384 bytes
12105 INFO: Writing RT_ICON 4 resource with 37019 bytes
12106 INFO: Writing RT_ICON 5 resource with 9640 bytes
12107 INFO: Writing RT_ICON 6 resource with 4264 bytes
12109 INFO: Writing RT_ICON 7 resource with 1128 bytes
12114 INFO: Copying 0 resources to EXE
12114 INFO: Embedding manifest in EXE
12116 INFO: Updating manifest in G:\项目文件\测试一下\dist\test.exe.notanexecutable
12117 INFO: Updating resource type 24 name 1 language 0
12121 INFO: Appending PKG archive to EXE
12129 INFO: Fixing EXE headers
12205 INFO: Building EXE from EXE-00.toc completed successfully.
打包成功了 |