# pyexe **Repository Path**: with-the-flow/pyexe ## Basic Information - **Project Name**: pyexe - **Description**: pyexe是一个基于PyInstaller的增强模块,主要解决Python程序打包过程中的路径问题,同时优化打包速度和文件体积。通过自动路径转换、GPU并行打包和智能压缩选择,提供更高效、更可靠的打包体验。 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-27 - **Last Updated**: 2025-11-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PyExe Module ## Overview **PyExe Module** is a custom tool built on top of [PyInstaller](https://www.pyinstaller.org/) designed to address several common issues encountered during the process of packaging Python applications into standalone executables. The primary focus is on resolving path-related issues, while also addressing secondary concerns such as slow packing times, large file sizes, and version compatibility. ## Features ### 1. Path Resolution One of the most significant challenges in creating standalone executables is handling file paths correctly. **PyExe Module** addresses this by: - **Dynamic Path Management**: Automatically adjusts paths based on the runtime environment. - **Configuration Flexibility**: Allows users to specify custom path configurations through configuration files or command-line arguments. ### 2. Improved Packing Time (Upcoming in 2.0.0) In version 2.0.0, we plan to enhance packing time by leveraging GPU parallelization for compiling and bundling dependencies. ### 3. Optimized File Size (Upcoming in 2.0.0) We will introduce an automatic compression mechanism that identifies and applies the most optimal compression method to reduce the size of the final executable. ### 4. Version Compatibility (Rolling Roadmap) Version 2.0.0 will focus on ensuring full backward compatibility with different versions of Python and PyInstaller, providing a seamless experience across various environments. ### 5. Disk Space Requirements and Dynamic Imports (Future Work) Addressing disk space requirements and potential issues with dynamic imports is planned for version 3.0.0. This includes better management of temporary files and more robust detection of dynamically imported modules. ## Installation To use **PyExe Module**, you first need to install it via pip: ```bash pip install pyexe-module ``` ## Usage ### Basic Example Here's a simple example of how to package a Python script using **PyExe Module**: ```python from pyexe_module import pack if __name__ == "__main__": pack( entry_point="your_script.py", output_dir="./dist", name="YourAppName" ) ``` ### Advanced Configuration You can customize the behavior of **PyExe Module** with additional parameters: ```python from pyexe_module import pack if __name__ == "__main__": pack( entry_point="your_script.py", output_dir="./dist", name="YourAppName", paths=["/path/to/additional/data"], hidden_imports=["module1", "module2"], debug=True, compress=True ) ``` #### Parameters - `entry_point`: The main Python script to be packaged. - `output_dir`: Directory where the compiled executable will be saved. - `name`: Name of the resulting executable. - `paths`: Additional directories containing resources (e.g., data files). - `hidden_imports`: List of modules that are dynamically imported but not automatically detected by PyInstaller. - `debug`: Enable debug mode for detailed logging. - `compress`: Compress the final executable to reduce its size. ## Known Issues ### Slow Packing Times While **PyExe Module** aims to provide efficient packaging, performance improvements involving GPU parallelization are planned for future releases. ### Large Executable Sizes Automatic compression mechanisms will be introduced in version 2.0.0 to help reduce the size of the generated executables. ### Limited Support for Dynamic Imports Handling of dynamically imported modules may still pose challenges. Full support and optimization for these cases is scheduled for version 3.0.0. ## Contributing Contributions are welcome! If you encounter any issues, have feature requests, or want to contribute code, please follow these guidelines: 1. Fork the repository. 2. Create a new branch for your changes. 3. Make your changes and write tests if applicable. 4. Submit a pull request. ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. ## Contact For questions, suggestions, or feedback, please contact us at [WQF_hello_world@163.com](mailto:WQF_hello_world@163.com).