Bug 168511 - There is no venv module in embedded Python distribution
Summary: There is no venv module in embedded Python distribution
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
25.8.1.1 release
Hardware: x86-64 (AMD64) Windows (All)
: medium enhancement
Assignee: Xisco Faulí
URL:
Whiteboard: target:26.2.0 target:25.8.3
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-22 21:24 UTC by denis.gz
Modified: 2025-11-08 19:30 UTC (History)
1 user (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 denis.gz 2025-09-22 21:24:20 UTC
Description:
--

Steps to Reproduce:
1. Open console window
2. Create a working folder for a new project, change to that folder:
   mkdir proj && cd proj
3. Add (prepend) "C:\Program Files\LibreOffice\program" to the PATH:
   set PATH=C:\Program Files\LibreOffice\program;%PATH%
4. Verify the python.exe to be executed is the one from LibreOffice:
   where python
5. Run command:
   python -m venv venv

Actual Results:
Error occurs:
C:\Program Files\LibreOffice\program\python-core-3.10.18\bin\python.exe: No module named venv

Expected Results:
The virtual environment named "venv" is created in the folder created on step 2


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Creating a virtual environment for any project is the standard approach in Python development. This helps a developer to ensure the development environment is the same as the runtime environment, and also makes packaging with ooscript easier. Lacking support for venv complicates development tasks, especially on Windows.
Comment 1 Xisco Faulí 2025-09-23 08:22:17 UTC
Fix in https://gerrit.libreoffice.org/c/core/+/191377
Comment 2 Commit Notification 2025-09-23 09:22:14 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#168511: python3: bundle venv

It will be available in 26.2.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 Commit Notification 2025-09-23 12:18:42 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

related tdf#168511: bundle venv on mac too + Add test

It will be available in 26.2.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 4 Commit Notification 2025-10-20 18:10:48 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

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

tdf#168511: python3: bundle venv

It will be available in 25.8.3.

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 5 Commit Notification 2025-10-20 18:10:50 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

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

related tdf#168511: bundle venv on mac too + Add test

It will be available in 25.8.3.

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 6 denis.gz 2025-11-06 21:39:43 UTC
(In reply to Commit Notification from comment #5)
> 
> It will be available in 25.8.3.
> 
> 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.
Tested venv against daily build 2025-11-06_04.09.06, unfortunately no progress at this time - still not working. There should be "scripts" folder in the "python-core-3.11.14\lib\venv" folder, and "venvlauncher.exe" binary in the "python-core-3.11.14\bin" folder. Otherwise, it won't work (and doesn't).
Comment 7 Commit Notification 2025-11-07 20:17:47 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/63460e46daa3a0ba2c897e00ba28d8cc26dac6dc

related tdf#168511: bundle venvlauncher.exe too

It will be available in 26.2.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 8 Xisco Faulí 2025-11-07 20:19:15 UTC
(In reply to denis.gz from comment #6)
> (In reply to Commit Notification from comment #5)
> > 
> > It will be available in 25.8.3.
> > 
> > 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.
> Tested venv against daily build 2025-11-06_04.09.06, unfortunately no
> progress at this time - still not working. There should be "scripts" folder
> in the "python-core-3.11.14\lib\venv" folder, and "venvlauncher.exe" binary
> in the "python-core-3.11.14\bin" folder. Otherwise, it won't work (and
> doesn't).

Hi Denis,
Thanks for you feedback. 63460e46daa3a0ba2c897e00ba28d8cc26dac6dc should fix the missing venvlauncher.exe. Could you try again with a newer daily build which includes that commit ?
Thanks in advance
Comment 9 denis.gz 2025-11-08 19:30:53 UTC
(In reply to Xisco Faulí from comment #8)
> Hi Denis,
> Thanks for you feedback. 63460e46daa3a0ba2c897e00ba28d8cc26dac6dc should fix
> the missing venvlauncher.exe. Could you try again with a newer daily build
> which includes that commit ?
> Thanks in advance

The result is as following:

C:\Users\User\project>python -m venv venv
Unable to copy 'C:\\Program Files\\LibreOfficeDev 25\\program\\venvlauncher.exe'
Error: [Errno 13] Permission denied: 'C:\\Program Files\\LibreOfficeDev 25\\program\\python-core-3.12.12'

Dunno what is it... The same happens both from Administrator and User prompt. This doesn't happen with venv module copied manually from another Python distro (as I described in my initial ticket).