Bug 166746 - PIP in LibreOffice 2025.8 breaks many things including numpy and Pandas when embedded python is used
Summary: PIP in LibreOffice 2025.8 breaks many things including numpy and Pandas when ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: Macro-Python
  Show dependency treegraph
 
Reported: 2025-05-27 11:48 UTC by vibrationoflife
Modified: 2025-05-30 18:38 UTC (History)
2 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 vibrationoflife 2025-05-27 11:48:24 UTC
PIP in LibreOffice 2025.8 May break many things including numpy and Pandas

I am the author of LibrePythonista Extension. Today I was testing the extension in LibreOffice Developer.

-------------------------------
Version: 25.8.0.0.alpha1 (X86_64) / LibreOffice Community
Build ID: a2896e060b54ce6ce36e3e29218fac40d2919c74
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
-------------------------------

This version of LibreOffice contains a pip installer. However, the pip installer is not a complete version.
It is missing several files such as the following in the C:\Program Files\LibreOfficeDev 25\program\python-core-3.11.12\lib\pip\_vendor\distlib folder:

- t32.exe
- t64.exe
- t64-arm.exe
- w32.exe
- w64.exe
- w64-arm.exe

When I try t install Pandas Manually in PowerShell I get the following Error:


-------------------------------
& "C:\Program Files\LibreOfficeDev 25\program\python.exe" -m pip install pandas

...
Installing collected packages: pytz, tzdata, six, numpy, python-dateutil, pandas
...
  File "C:\Program Files\LibreOfficeDev 25\program\python-core-3.11.12\lib\pip\_vendor\distlib\scripts.py", line 339, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Program Files\LibreOfficeDev 25\program\python-core-3.11.12\lib\pip\_vendor\distlib\scripts.py", line 260, in _write_script
    launcher = self._get_launcher('t')
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\LibreOfficeDev 25\program\python-core-3.11.12\lib\pip\_vendor\distlib\scripts.py", line 419, in _get_launcher
    raise ValueError(msg)
ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
-------------------------------

The t64.exe file and maybe more seem to be required to install Pandas.

I suspect any existing methods to install Pandas and some other packages into LibreOffice will fail when embedded python with pip is used.

This also affect LibrePythonista is it also installs Numpy, Pandas and more, or at least did on previous versions.
With the built in pip LIbrePythonista can no longer Install the required packages. It is not really possible or recommended to install a second pip to get around this.

I tired a workaround just to see if it could work and it does.
My workaround was to download embeddable python 3.11.12 3 and extract is contents.
Then I replaced C:\Program Files\LibreOfficeDev 25\program\python-core-3.11.12\lib\pip with the pip from the embedded version.

I tested installing LibrePythonista and Pandas again and it worked.

See Also:
- https://ask.libreoffice.org/t/pip-in-libreoffice-2025-8-may-break-many-things-including-numpy-and-pandas/
- https://g.co/gemini/share/eef328cdc075
Comment 1 Xisco Faulí 2025-05-27 12:03:34 UTC
Thanks for reporting this issue. I don't have a Win build to test it but I think https://gerrit.libreoffice.org/c/core/+/185907 should fix it
Comment 2 Commit Notification 2025-05-27 13:20:20 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#166746: pip: include .exe files

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 3 Xisco Faulí 2025-05-28 15:26:43 UTC
Hello,
there is a new daily build for windows containing the fix in https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb77-TDF/current/
Could you please install it to check whether my patch fixes the issue ?
Thanks in advance
Comment 4 vibrationoflife 2025-05-29 02:38:25 UTC
I downloaded and installed the latest nightly build and tested againg.

The results are mostly good.
I installed several packages without issued.
- ooodev
- sortedcontainers
- verr
- numpy
- pandas- pillow

and more.

I tried another package named odfpy and this is were things got really strange.
I tired to resolve why it was failing for hours.

I thought maybe it does not install in LibreOfficeDev and python 3.11 even though it does install in LibreOffice and Python 3.9. This turns out not the be the issue. I verified this by installing python 3.11.9 no my system, using pyenv for windows, I created a virtual environment using python 3.11.9 then I activated the virtual environment and installed odfpy without any issue at all.

I have a long conversation with Google Gemini about this trying to resolve the issue. Gemini's final thoughts were that the pip was actually broken.

The whole conversation can be found here: https://g.co/gemini/share/7486a94d7a6b


The Error is as follows:

& "C:\Program Files\LibreOfficeDev 25\program\python.exe" -m pip install odfpy

Defaulting to user installation because normal site-packages is not writeable

Collecting odfpy

  Using cached odfpy-1.4.1.tar.gz (717 kB)

  ERROR: Error [WinError 5] Access is denied while executing command python setup.py egg_info

  Preparing metadata (setup.py) ... error

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied

Check the permissions.
Comment 5 Mike Kaganski 2025-05-29 07:01:16 UTC
(In reply to vibrationoflife from comment #4)

Could you please use a tool like Sysinternals Procmon, and find out which Access Denied could be the culprit? Thanks.
Comment 6 Xisco Faulí 2025-05-29 09:52:43 UTC
Hi vibrationoflife@pm.me,
Thanks for your feedback. I think we can close this issue for now. the issue you are describing in comment 4 is likely another issue not related to the initial report. Please try what Mike suggested in comment 5 and fill a new report for it.
Thanks in advance.
Comment 7 vibrationoflife 2025-05-29 10:33:44 UTC
I did use Procmon. I am new to the tool, however I could not get to the root of the issue. There is a whole section in the Gemini conversation https://g.co/gemini/share/7486a94d7a6b about Procmon and how the error was not giving expected results.

I am baffled why the odfpy package installs in LibreOffice with Python 3.9. Installs in a virtual environment with Python 3.11. Does NOT install for LibreOfficeDev with Python 3.11. I am speaking of windows of course.

BTW I also tested Om a Mac book Air M2 for LibreOfficeDev, Did not install odfpy but all other packages such as matplotlib,numpy and pandas installed fine.
Comment 8 vibrationoflife 2025-05-30 18:38:06 UTC
Well,odfpy now seems to be working on my Windows 10 system.

The only change I made was install python 3.11.9 using Pyenv. pyenv is a tool used to manage multiple versions of python in your machine. I should not affect LibeOffice or LibreOfficeDev in any way.

I completely removed LibreOfficeDev, python 3.11 folder and Users Folder.

I installed LibreOfficeDev again and then tried installing odfpy in powershell and it worked fine. I spent hours trying to figure out the initial failure. I have no idea why it started working.

>& "C:\Program Files\LibreOfficeDev 25\program\python.exe" -m pip install --upgrade --target=C:\Users\bigby\AppData\Roaming\Python\Python311\site-packages 'odfpy>=1.4'
Collecting odfpy>=1.4
  Using cached odfpy-1.4.1-py2.py3-none-any.whl
Collecting defusedxml (from odfpy>=1.4)
  Using cached defusedxml-0.7.1-py2.py3-none-any.whl.metadata (32 kB)
Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Installing collected packages: defusedxml, odfpy
Successfully installed defusedxml-0.7.1 odfpy-1.4.1