Python PyPy和PyInstaller

Python PyPy和PyInstaller,python,pyinstaller,pypy,Python,Pyinstaller,Pypy,是否可以使用PyInstaller构建单个二进制或单个目录包,并使用pypy作为解释器 有什么特别的技巧吗 PyInstaller的一些替代方案 如果没有,根本的技术原因是什么 注意pyinstaller为什么/如何不使用pypy开箱即用: distutils.sysconfig.get_config_h_文件名缺失,已在pytinstaller主干中修复 (distutils.|)sysconfig。(124;)get_makefile_文件名缺失,实际上是可选的 尝试在单个可执行文件中链接

是否可以使用
PyInstaller
构建单个二进制或单个目录包,并使用
pypy
作为解释器

有什么特别的技巧吗

PyInstaller的一些替代方案

如果没有,根本的技术原因是什么

注意pyinstaller为什么/如何不使用pypy开箱即用:

  • distutils.sysconfig.get_config_h_文件名缺失,已在pytinstaller主干中修复
  • (distutils.|)sysconfig。(124;)get_makefile_文件名缺失,实际上是可选的
  • 尝试在单个可执行文件中链接libpython2.7.so.1,pypy,而不是共享对象

    • 我已经尝试过这个方法,但多次失败,因为PyPy只能处理CPython使用的部分内容。PyInstaller是一个成熟的CPython应用程序,因此无法通信

      PyInstaller的机制对CPython的工作方式很敏感,因此PyPy可以引入一些问题。这是在PyPy虚拟环境中尝试运行PyInstaller时得到的结果:

      OSError: Python library not found: Python, .Python, libpython3.5.dylib,
      libpython3.5m.dylib
      
      This would mean your Python installation doesn't come with proper library files.
      
      This usually happens by missing development package, or unsuitable build
      parameters of Python installation.
      
      * On Debian/Ubuntu, you would need to install Python development packages
        * apt-get install python3-dev
        * apt-get install python-dev
      * If you're building Python by yourself, please rebuild your Python with
        `--enable-shared` (or, `--enable-framework` on Darwin)
      
      如果您需要提高速度并将代码隐藏起来,您可以尝试一下。我经常使用Cython和PyInstaller,我喜欢它们的跨平台特性


      当你完成这两项工作后,你可以使用PyInstaller和CPython来打包你的应用程序。

      p.S.我也对二进制补丁工具持开放态度(alin to
      LD_PRELOAD
      ,但会产生一个库),如果有人能做一个演示:)一个替代
      PyInstaller
      的方法,谢谢,@vivien,遗憾的是,这些都不支持
      pypypy
      。快速检查表明,它主要是针对CPython内部的简单C级钩子的集合,但也有一些复杂的东西,运行时内置到解释器内置类型,按需解包用户
      py/pyc/pyo
      文件。你说得对。当我的交货时间很紧时,我会尽可能地避免这些问题。这就是为什么我使用上面为您概述的方法。