Git Product home page Git Product logo

Comments (1)

hhstore avatar hhstore commented on June 16, 2024 1
  • 这个不是 nicegui 的问题.
  • 是 Python 顽疾.
  • 基于 pyinstaller 等工具打包 Python 项目成 app, 启动都很慢.
  • 即使是换别的工具, 也会有新的问题. (我 repo 里, 基本都测试了, 都不好用)

启动慢的主要原因:

  • 是打包了 Python 解释器, Python 解释器启动很慢. (类似 Java JVM 启动)
  • 打包(如果是 onefile), 本质是类似 zip, 存在解压过程.
  • 所以, 常态是 10-20s 才能打开. 这个目前是无解的.
  • 不光慢, pyinstaller 打包 nicegui (MacOS) 还会出现打开后, 疯狂创建 main 进程(bug). 原因是 pyinstaller 打包多进程项目, 有 bug. 而 nicegui 内部实现, 依赖 多进程.

绕行解决办法: (绿色模式)

  • 原理: 过去 Windows 平台, 常见的 绿色免安装软件.
  • 做法: 打包 Python 解释器 + pip 依赖包 + 源码编译结果 pyz, 一起打包发布.
  • 优点: 启动快.
  • 缺点: 每个平台, 都要打包对应平台的 Python.

可以参考:

教程:

工具:

原理:

from learn-py.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.