Fără Descriere

zzc 710296def9 first commit 1 an în urmă
__pycache__ 710296def9 first commit 1 an în urmă
algorithm 710296def9 first commit 1 an în urmă
bll 710296def9 first commit 1 an în urmă
bootstrap 710296def9 first commit 1 an în urmă
input 710296def9 first commit 1 an în urmă
output 710296def9 first commit 1 an în urmă
util 710296def9 first commit 1 an în urmă
.env 710296def9 first commit 1 an în urmă
main.py 710296def9 first commit 1 an în urmă
main.spec 710296def9 first commit 1 an în urmă
mf2005.exe 710296def9 first commit 1 an în urmă
readme.md 710296def9 first commit 1 an în urmă

readme.md

打包部署

  1. 前端打包,将打包结果文件放入output/page
  2. python打包exe,参考:https://zhuanlan.zhihu.com/p/579528855

pyinstaller main.py,生成main.spec文件后终止

main.spec文件中添加

import glob, os
rasterio_imports_paths1 = glob.glob(r'C:\Users\admin\Anaconda3\envs\huanglx\Lib\site-packages\rasterio\*.py')
rasterio_imports_paths2 = glob.glob(r'C:\Users\admin\Anaconda3\envs\huanglx\Lib\site-packages\rasterio\*.pyd')
hidden_imports = [
'fiona._shim',
'fiona.schema',
'rasterio._shim',
'rasterio.sample',
]

for item in rasterio_imports_paths1:
    current_module_filename = os.path.split(item)[-1]
    current_module_filename = 'rasterio.'+current_module_filename.replace('.py', '')
    hidden_imports.append(current_module_filename)
for item in rasterio_imports_paths2:
    current_module_filename = os.path.split(item)[-1]
    current_module_filename = 'rasterio.'+current_module_filename.replace('.pyd', '')
    current_module_filename = current_module_filename.split('.')[0] + '.' + current_module_filename.split('.')[1]
    hidden_imports.append(current_module_filename)

hiddenimports=hidden_imports
  1. 执行pyinstaller main.spec,将outputinput文件夹、.env文件和mf2005.exe拷贝至main.exe同级目录