Bug 162786 - Ship Python package manager (PIP) with LibreOffice internal Python
Summary: Ship Python package manager (PIP) with LibreOffice internal Python
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:25.8.0 target:25.2.1 inRelease...
Keywords:
Depends on:
Blocks: Macro-Python Dev-related
  Show dependency treegraph
 
Reported: 2024-09-04 10:22 UTC by Hossein
Modified: 2025-03-28 20:44 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2024-09-04 10:22:07 UTC
Description:
PIP is the famous Python package manger which is widely used to install and manage Python packages. This ticket is the feature request for installing and shipping PIP with LibreOffice core builds.

https://en.wikipedia.org/wiki/Pip_(package_manager)

Currently, PIP is not shipped with LibreOffice internal Python. There are multiple reasons to have that inside LibreOffice core. I can enumerate at least these reasons:

1. Installing PIP with extensions have issues, I myself have issues installing it on Linux.
2. Having PIP in core removes the need to create a LO extension for each and every PIP package.
3. Having PIP inside core lets other developers test it on different platforms, add more functionalities and make it robust.
4. It makes easier for the Python extensions to use other Python packages.

Therefore, installing PIP can be an important enhancement for LibreOffice internal Python.
Comment 1 Mike Kaganski 2024-09-04 10:37:29 UTC
I set it to NEW; it's really wanted feature. But I add Michael to CC, possibly there are some considerations to take care about? (IIRC, Michael was the last to remove some Python packages; if I'm mistaken, I apolojize).
Comment 2 Mike Kaganski 2024-09-04 11:40:20 UTC
Another way to see how it's important is https://ask.libreoffice.org/search?q=python%20pip
Comment 3 Roman Kuznetsov 2024-09-04 17:51:17 UTC
Let's just use system Python in Windows, in Linux and in macOS.
Or another variant - add full Python to LibreOffice.
We will have no problems then with any standard Python modules/libraries that LO's Python doesn't have
Comment 4 Mike Kaganski 2024-09-04 18:01:22 UTC
(In reply to Roman Kuznetsov from comment #3)

There is no system python on Windows. We can't do that. As well as on macOS, by the way. Please don't suggest this, because this simply distracts the discussion.
Comment 5 Michael Stahl (allotropia) 2024-09-05 09:04:48 UTC
i don't remember why pip is omitted currently, probably because it's not needed to run extensions? but you are right, it could be useful for developing extensions...

i guess we want to avoid bundling python modules that have additional external dependencies, and GUI toolkits, but other than that, i don't see any downsides.
Comment 6 Roman Kuznetsov 2024-09-05 12:43:59 UTC
(In reply to Mike Kaganski from comment #4)
> (In reply to Roman Kuznetsov from comment #3)
> 
> There is no system python on Windows. We can't do that. As well as on macOS,
> by the way. 

If it will be a solution we can suggest user to download and install it from Python official site.
Btw, macOS has a Python inside, but it's a strange Python (like our Python inside LibreOffice) and all Python devs advise to install Python from its official site too =)

> Please don't suggest this, because this simply distracts the
> discussion.

this discussion can give us again only partially solution of global problem that can have (and should have) one full solution by using full functional Python by one or another way.
Comment 7 Xisco Faulí 2024-12-19 08:51:14 UTC
After https://git.libreoffice.org/core/+/02363a5cf5ef95b9958a05c4b3af2fba18549226%5E%21, pip can be installed with "instdir/program/python -m ensurepip"
Comment 8 Commit Notification 2025-01-21 21:06:22 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/47e110fc66292e76152252a90a0e20580c33c13d

tdf#162786, tdf#161947: Add support for setuptools and pip

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 nobu 2025-01-25 04:02:08 UTC
I don't use it, but I can make sure it's available.

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1412f0235405e71aaa327596e3db71ffa999e122
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (ja_JP); UI: en-US
Calc: CL threaded
Comment 10 Commit Notification 2025-01-27 14:47:03 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3575986e30705d588d4eea94eb669474a3adbf77

tdf#162786, tdf#159988: python3: do not strip soabi on linux/macOS

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2025-01-27 19:12:30 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3b18d95ba3f3137528a208d68d40d12407b36372

related tdf#162786: Add cacert.pem

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Xisco Faulí 2025-01-27 19:34:11 UTC
After  3575986e30705d588d4eea94eb669474a3adbf77 and  3b18d95ba3f3137528a208d68d40d12407b36372 pip should work as expected. E.g: instdir/program/python -m pip install numpy
Testing is appreciated.
Comment 13 Timur 2025-01-29 14:43:13 UTC
Should be in https://wiki.documentfoundation.org/ReleaseNotes/25.8.
Comment 14 Commit Notification 2025-02-06 09:24:25 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/e0c736642a34d10d899fc8a8a55ef2483b6b46d5

tdf#162786, tdf#159988: python3: do not strip soabi on linux/macOS

It will be available in 25.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Xisco Faulí 2025-02-12 15:48:25 UTC
(In reply to Timur from comment #13)
> Should be in https://wiki.documentfoundation.org/ReleaseNotes/25.8.

done
Comment 16 Commit Notification 2025-03-28 20:44:54 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/315febd7ead36519b627bb3d8980b32f393c6062

related tdf#162786, tdf#159988: fix arm64 for linux

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.