Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fwd: How can I build embeddable zip python on Linux

279 views
Skip to first unread message

Filip Bascarevic

unread,
Jun 4, 2020, 9:53:12 AM6/4/20
to
Dear Python team,



I have tried to build the GDB with Python support for windows. Because I
didn’t want to have any Python dependence on building system, I decided to
embed python in GDB using Windows x86_64 embeddable zip file and with it I
had success.

When I tried to build GDB with Python support on Linux, I realized I
couldn’t find embeddable python for Linux. I have tried to find some
article how can I build embeddable Python from source in Linux and only
what I have found is this:

https://stackoverflow.com/questions/42280553/how-to-build-embeddable-python

but again it is only for Windows.



Please, can you give me some instructions how can I build embeddable Python
from source in Linux? Is it possible in the Linux environment?



Please let me know if I can assist any further.



With best regards,



M.Eng. Filip Bascarevic

Michael Torrie

unread,
Jun 5, 2020, 12:13:04 AM6/5/20
to
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).

Luuk

unread,
Jun 5, 2020, 2:50:11 AM6/5/20
to

Luuk

unread,
Jun 5, 2020, 2:52:36 AM6/5/20
to
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
0 new messages