Fwd: How can I build embeddable zip python on Linux

Luuk luuk at invalid.lan
Fri Jun 5 02:52:28 EDT 2020


On 5-6-2020 08:49, Luuk wrote:
> On 5-6-2020 06:12, Michael Torrie wrote:
>> On 6/4/20 2:47 AM, Filip Bascarevic wrote:
>>> When I tried to build GDB with Python support on Linux, I realized I
>>> couldn’t find embeddable python for Linux.
>>>
>>> Please, can you give me some instructions how can I build embeddable Python
>>> from source in Linux? Is it possible in the Linux environment?
>>
>> What does "embeddable python" mean?  Do you mean the libpython shared
>> library and C API?  If so it's just a matter of installing the correct
>> -devel or -dev package on your distro. On Debian this would likely be
>> libpython#.#-dev where # is the version. For example, libpython3.8-dev.
>> On Fedora that might be python-devel (or on CentOS, python36-devel).
>>
> 
> probably the same as asked here (with no answer (yet)):
> https://stackoverflow.com/questions/49425397/building-an-embeddable-minimal-python-distribution-on-linux
> 
> 

https://docs.python.org/3.5/using/windows.html#embedded-distribution

3.8. Embedded Distribution
New in version 3.5.

The embedded distribution is a ZIP file containing a minimal Python environment. It is intended for acting as part of another application, rather than being directly accessed by end-users.

When extracted, the embedded distribution is (almost) fully isolated from the user’s system, including environment variables, system registry settings, and installed packages. The standard library is included as pre-compiled and optimized .pyc files in a ZIP, and python3.dll, python35.dll, python.exe and pythonw.exe are all provided. Tcl/tk (including all dependants, such as Idle), pip and the Python documentation are not included.

Note The embedded distribution does not include the Microsoft C Runtime and it is the responsibility of the application installer to provide this. The runtime may have already been installed on a user’s system previously or automatically via Windows Update, and can be detected by finding ucrtbase.dll in the system directory.
Third-party packages should be installed by the application installer alongside the embedded distribution. Using pip to manage dependencies as for a regular Python installation is not supported with this distribution, though with some care it may be possible to include and use pip for automatic updates. In general, third-party packages should be treated as part of the application (“vendoring”) so that the developer can ensure compatibility with newer versions before providing updates to users.

The two recommended use cases for this distribution are described below

-- 
Luuk


More information about the Python-list mailing list