Bug 168514 - There is no pythonw.exe executable in embedded Python distribution
Summary: There is no pythonw.exe executable 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: All Windows (All)
: medium enhancement
Assignee: Xisco Faulí
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Macro-Python
  Show dependency treegraph
 
Reported: 2025-09-22 22:33 UTC by denis.gz
Modified: 2025-11-06 22:57 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 22:33:06 UTC
Description:
The pythonw.exe executable is used on Windows for GUI applications. It only differs from python.exe in that when the application runs, it doesn't create a console window. Sometimes applications have their own startup executable, in this case the application would fail to run.

Steps to Reproduce:
1. Using pip command, install some package which contains a GUI app (for example,
   "pip install spyder", provided that bug #168512 is resolved)
2. Run the app

Actual Results:
The application fails with a message saying that it's "Unable to create process using pythonw.exe": The system cannot find the file specified.

Expected Results:
The application runs successfully.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
An easy workaround exists, consisting in copying python.exe as pythonw.exe at the same location (venv or program folder), however an empty console window is created when the application is run.
Comment 1 Xisco Faulí 2025-10-31 11:05:18 UTC
I think I know how to fix this issue
Comment 2 Commit Notification 2025-10-31 15:45:07 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#168514: Add pythonw.exe

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 Xisco Faulí 2025-10-31 15:45:59 UTC
@denis.gz@gmail.com, I think my patch fixes this issue but it was a blind fix. Please test it and give feedback. Thanks in advance
Comment 4 denis.gz 2025-11-01 08:53:46 UTC
(In reply to Xisco Faulí from comment #3)
> @denis.gz@gmail.com, I think my patch fixes this issue but it was a blind
> fix. Please test it and give feedback. Thanks in advance

Thanks, looks good. I'll check all my Python bugs in the next nightly build, will comment on results.
Comment 5 denis.gz 2025-11-06 21:54:01 UTC
Checked against build 2025-11-06_04.09.06, there is no pythonw.exe binary at this time.
Comment 6 Xisco Faulí 2025-11-06 21:55:03 UTC
(In reply to denis.gz from comment #5)
> Checked against build 2025-11-06_04.09.06, there is no pythonw.exe binary at
> this time.

please, paste the info from help - about LibreOffice
Comment 7 denis.gz 2025-11-06 22:05:13 UTC
Version: 25.8.4.0.0+ (X86_64) / LibreOffice Community
Build ID: 0a22cd7868a887d27503907c1f1edd81aae553cb
CPU threads: 2; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 8 Xisco Faulí 2025-11-06 22:06:56 UTC
you have to use master: https://dev-builds.libreoffice.org/daily/master/current.html
Comment 9 denis.gz 2025-11-06 22:44:34 UTC
(In reply to Xisco Faulí from comment #8)
> you have to use master:
> https://dev-builds.libreoffice.org/daily/master/current.html

I see, updated to 26.2.0.0.alpha0+

The pythonw.exe is there. Cannot check the functionality though, as both pip and venv are broken (ensurepip is missing _bundled, and venv is missing scripts and venvlauncher.exe).
Comment 10 denis.gz 2025-11-06 22:57:25 UTC
Also, as an (un)related observation, I've tried to run my script which I developed on 25.2 on a fresh LO install, and I receive the following error:

com.sun.star.uno.RuntimeException: Error during invoking function make_statement in module vnd.sun.star.tdoc:/1/Scripts/python/RevenueStatement.py (<class 'AttributeError'>: module 'urllib' has no attribute 'error'
  File "C:\Program Files\LibreOfficeDev 25\program\pythonscript.py", line 941, in invoke
    ret = self.func(*args)
          ^^^^^^^^^^^^^^^^
  File "vnd.sun.star.tdoc:/1/Scripts/python/RevenueStatement.py", line 47, in make_statement
  File "C:\Users\User\AppData\Local\Temp\tmps8q6uuw8\script_uno.py", line 374, in make_statement
  File "C:\Users\User\AppData\Local\Temp\tmps8q6uuw8\script_uno.py", line 217, in get_contract_data
)


The line at script_uno.py:374 looks like this:

except urllib.error.HTTPError as e:


Which makes me a little puzzled what's wrong here... The same error on released build.