We have a python based module which we want to distribute to our customers by creating a compiled copy understandable by linux system(i.e. .so file)
我们有一个基于python的模块,我们希望通过创建linux系统可以理解的编译副本(即.so文件)分发给我们的客户
We have evaluated cython which does this quite easily, but we're seeing it's creating as many .so file as .pyx/.py file but we want to make one uber .so file for complete package. We want to do it smartly in a sense that if we add dependency to other module in future, uber compiled file should have all the dependencies.
我们已经评估了很容易实现这一点的cython,但是我们看到它创建的.so文件和.pyx / .py文件一样多,但是我们希望为完整的包创建一个超级.so文件。我们想要巧妙地做到这一点,如果我们将来向其他模块添加依赖,那么uber编译的文件应该具有所有的依赖关系。
Any recommendations, how we can do it neatly?
任何建议,我们如何能够整齐地做到这一点?
1 个解决方案
#1
2
cx_freeze can create re-distributable packages of python modules.
cx_freeze可以创建可重新分发的python模块包。
For example:
例如:
cxfreeze my_script_using_my_python_module.py --target-dir dist
cxfreeze my_script_using_my_python_module.py --target-dir dist
Whether the python package is compiled or regular python is not really relevant. What is relevant is that your customers will need to have compatible python version, as well as compatible libc/gcc, to run it.
python包是编译还是常规python并不是真正相关的。相关的是,您的客户需要具有兼容的python版本以及兼容的libc / gcc才能运行它。
So for the purposes of distributing a python module to third parties, a single .so
will not be compatible with everyone. Ever.
因此,为了将python模块分发给第三方,单个.so将与所有人不兼容。永远。
cx_freeze
bundles the required python interpreter version and python packages so there are no dependencies. It is also cross-platform.
cx_freeze捆绑了所需的python解释器版本和python包,因此没有依赖项。它也是跨平台的。
#1
2
cx_freeze can create re-distributable packages of python modules.
cx_freeze可以创建可重新分发的python模块包。
For example:
例如:
cxfreeze my_script_using_my_python_module.py --target-dir dist
cxfreeze my_script_using_my_python_module.py --target-dir dist
Whether the python package is compiled or regular python is not really relevant. What is relevant is that your customers will need to have compatible python version, as well as compatible libc/gcc, to run it.
python包是编译还是常规python并不是真正相关的。相关的是,您的客户需要具有兼容的python版本以及兼容的libc / gcc才能运行它。
So for the purposes of distributing a python module to third parties, a single .so
will not be compatible with everyone. Ever.
因此,为了将python模块分发给第三方,单个.so将与所有人不兼容。永远。
cx_freeze
bundles the required python interpreter version and python packages so there are no dependencies. It is also cross-platform.
cx_freeze捆绑了所需的python解释器版本和python包,因此没有依赖项。它也是跨平台的。