Missing Python Runtime (search)

Windows specific questions, problems.
User avatar
Peter
Administrator
Administrator
Posts: 2702
Joined: Wed Jul 07, 2010 6:14 pm

Re: Missing Python Runtime (search)

Post by Peter »

Bit late but what do you get for:

Code: Select all

python --version
now?

Also is your Windows in US locale?

What happens is basically is that "python --version" gets called and the version.h file checks the output and fails for you. I talked with Sledge but they didn't write this function/helper. Python has some in-built calls that could be used as an alternative in the file instead of this solution. I'd do a PR but it might just get thrown out so.. eh. I don't know.
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: Missing Python Runtime (search)

Post by sledgehammer_999 »

@Peter since you are keen into providing builds with more debugging info you can try one by applying the following diff on the v4.6.0 code.
It will print to the log more info about the Python installs it encounters.
Unfortunately I don't have time to commit and follow up on this, that's why I am posting the diff.

Code: Select all

diff --git a/src/base/utils/foreignapps.cpp b/src/base/utils/foreignapps.cpp
index 683c19ee3..c2feb6458 100644
--- a/src/base/utils/foreignapps.cpp
+++ b/src/base/utils/foreignapps.cpp
@@ -52,14 +52,18 @@ namespace
 {
     bool testPythonInstallation(const QString &exeName, PythonInfo &info)
     {
+        LogMsg(u"PYTHON: Testing python at: \'%1\'"_s.arg(exeName), Log::INFO);
         QProcess proc;
         proc.start(exeName, {u"--version"_s}, QIODevice::ReadOnly);
         if (proc.waitForFinished() && (proc.exitCode() == QProcess::NormalExit))
         {
             QByteArray procOutput = proc.readAllStandardOutput();
+            LogMsg(u"PYTHON: ProcOutput: \'%1\'"_s.arg(QString::fromLocal8Bit(procOutput)), Log::INFO);
             if (procOutput.isEmpty())
                 procOutput = proc.readAllStandardError();
+            LogMsg(u"PYTHON: ProcOutput2: \'%1\'"_s.arg(QString::fromLocal8Bit(procOutput)), Log::INFO);
             procOutput = procOutput.simplified();
+            LogMsg(u"PYTHON: ProcOutputSimplified: \'%1\'"_s.arg(QString::fromLocal8Bit(procOutput)), Log::INFO);
 
             // Software 'Anaconda' installs its own python interpreter
             // and `python --version` returns a string like this:
User avatar
Peter
Administrator
Administrator
Posts: 2702
Joined: Wed Jul 07, 2010 6:14 pm

Re: Missing Python Runtime (search)

Post by Peter »

Thank you Sledge for helping out. I'll be able to send a build tomorrow some time (there is some project work and whatnot.)

Update: sent the build via PM
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

Peter wrote: Sun Nov 05, 2023 8:53 pm Thank you Sledge for helping out.
Absolutely nothing in the logs about Python... Not a single line!

Also...

Code: Select all

C:\Windows\System32>python --version
Python 3.8.10

C:\Windows\System32>where python
C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38\python.exe
C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps\python.exe

C:\Windows\System32>powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Windows\System32> systeminfo /FO csv | ConvertFrom-Csv | select *locale

System Locale Input Locale
------------- ------------
pl;Polish     en-us;English (United States)


PS C:\Windows\System32> whuh? Polish?? lmao

PS C:\Windows\System32> Get-UICulture

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)


PS C:\Windows\System32> Get-Host


Name             : ConsoleHost
Version          : 5.1.22621.2428
InstanceId       : f05c07d0-1cc1-4787-858c-c3846a129b1f
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : nl-NL
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
But also from https://serverfault.com/a/888387/617855:

Code: Select all

C:\Windows\System32>notepad get_locale.cmd

C:\Windows\System32>get_locale.cmd
SYSTEM_LOCALE=pl
SYSTEM_LOCALE_WITH_SEMICOLON=pl;
VERBOSE_SYSTEM_LOCALE=Polish
Again the Polish!! Grmbl.

https://serverfault.com/a/787788/617855

Code: Select all

C:\Windows\System32>notepad get_locale.bat

C:\Windows\System32>get_locale.bat
pl
So let's check the GUI solutions... Found the culprit and will reboot next and <EDIT>

Code: Select all

C:\Windows\System32>get_locale.bat
en-us

C:\Windows\System32>get_locale.cmd
SYSTEM_LOCALE=en-us
SYSTEM_LOCALE_WITH_SEMICOLON=en-us;
VERBOSE_SYSTEM_LOCALE=English (United States)
User avatar
Peter
Administrator
Administrator
Posts: 2702
Joined: Wed Jul 07, 2010 6:14 pm

Re: Missing Python Runtime (search)

Post by Peter »

Super weird there is nothing in logs. I ran it inside the VM and the added new prints all appeared. Huh. Did you open the Search tab? I'll check the file I sent again, its weird.
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

After the reboot I started your QT again. Did a View... Search Engine and got greeted with yet another full Python installation routine.

These are the logs after two View - Search Engine - setups:

Code: Select all

8-11-2023 10:11 - Python not detected
8-11-2023 10:11 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:11 - PYTHON: ProcOutput2: ''
8-11-2023 10:11 - PYTHON: ProcOutput: ''
8-11-2023 10:11 - PYTHON: Testing python at: 'C:/Users/Gebruiker/AppData/Local/Programs/Python/Python38/python.exe'
8-11-2023 10:11 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:11 - PYTHON: ProcOutput2: ''
8-11-2023 10:11 - PYTHON: ProcOutput: ''
8-11-2023 10:11 - PYTHON: Testing python at: 'python'
8-11-2023 10:11 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:11 - PYTHON: ProcOutput2: ''
8-11-2023 10:11 - PYTHON: ProcOutput: ''
8-11-2023 10:11 - PYTHON: Testing python at: 'python3'
8-11-2023 10:11 - Python not detected
8-11-2023 10:11 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:11 - PYTHON: ProcOutput2: ''
8-11-2023 10:11 - PYTHON: ProcOutput: ''
8-11-2023 10:11 - PYTHON: Testing python at: 'C:/Users/Gebruiker/AppData/Local/Programs/Python/Python38/python.exe'
8-11-2023 10:11 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:11 - PYTHON: ProcOutput2: ''
8-11-2023 10:11 - PYTHON: ProcOutput: ''
8-11-2023 10:11 - PYTHON: Testing python at: 'python'
8-11-2023 10:11 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:11 - PYTHON: ProcOutput2: ''
8-11-2023 10:11 - PYTHON: ProcOutput: ''
8-11-2023 10:10 - PYTHON: Testing python at: 'python3'
8-11-2023 10:09 - Python not detected
8-11-2023 10:09 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:09 - PYTHON: ProcOutput2: ''
8-11-2023 10:09 - PYTHON: ProcOutput: ''
8-11-2023 10:09 - PYTHON: Testing python at: 'C:/Users/Gebruiker/AppData/Local/Programs/Python/Python38/python.exe'
8-11-2023 10:09 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:09 - PYTHON: ProcOutput2: ''
8-11-2023 10:09 - PYTHON: ProcOutput: ''
8-11-2023 10:09 - PYTHON: Testing python at: 'python'
8-11-2023 10:09 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:09 - PYTHON: ProcOutput2: ''
8-11-2023 10:09 - PYTHON: ProcOutput: ''
8-11-2023 10:09 - PYTHON: Testing python at: 'python3'
8-11-2023 10:08 - Python not detected
8-11-2023 10:08 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:08 - PYTHON: ProcOutput2: ''
8-11-2023 10:08 - PYTHON: ProcOutput: ''
8-11-2023 10:08 - PYTHON: Testing python at: 'C:/Users/Gebruiker/AppData/Local/Programs/Python/Python38/python.exe'
8-11-2023 10:08 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:08 - PYTHON: ProcOutput2: ''
8-11-2023 10:08 - PYTHON: ProcOutput: ''
8-11-2023 10:08 - PYTHON: Testing python at: 'python'
8-11-2023 10:08 - PYTHON: ProcOutputSimplified: ''
8-11-2023 10:08 - PYTHON: ProcOutput2: ''
8-11-2023 10:08 - PYTHON: ProcOutput: ''
8-11-2023 10:08 - PYTHON: Testing python at: 'python3'
8-11-2023 10:07 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP[snip]: no router found"

Code: Select all

C:\Windows\System32>where python
C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\python.exe
C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38\python.exe
C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps\python.exe

C:\Windows\System32>python --version
Python 3.10.11

Code: Select all

C:\Windows\System32>cd "C:/Users/Gebruiker/AppData/Local/Programs/Python/Python38"

C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38>dir *.exe
 Volume in drive C is i9-I
 Volume Serial Number is 86C1-1218

 Directory of C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38

03-05-2021  11:54           101.552 python.exe
03-05-2021  11:54           100.016 pythonw.exe
               2 File(s)        201.568 bytes
               0 Dir(s)  279.112.032.256 bytes free
Last edited by bitcoin on Wed Nov 08, 2023 9:18 am, edited 3 times in total.
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

Peter wrote: Wed Nov 08, 2023 9:07 am Super weird there is nothing in logs. I ran it inside the VM and the added new prints all appeared. Huh. Did you open the Search tab? I'll check the file I sent again, its weird.
Nothing in the logs IF I DON'T CLICK SEARCH ENGINE and ONLY START qB :)

See my last update!

EDIT: running qB as an admin doesn't change anything in the logs or results

xx
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

oh just super, qB 4.5.5 started freezing up again... Sigh. wtf is going on!!!!!

I'm gonna close qB 4.5.5 and remove Python 3.10 first, with iObit.
EDIT: still unstable! And it keeps insisting on an update, even after telling it no once or twice before. Even scrolling is impossible until it finally gives up asking. I'll now test how stable it remains.

I'm going to close qB 4.5.5 and remove Python 3.8 next, with iObit.
NEW EDIT:
User avatar
Peter
Administrator
Administrator
Posts: 2702
Joined: Wed Jul 07, 2010 6:14 pm

Re: Missing Python Runtime (search)

Post by Peter »

bitcoin wrote: Wed Nov 08, 2023 9:13 am After the reboot I started your QT again. Did a View... Search Engine and got greeted with yet another full Python installation routine.
...
It's like.. there is NO output from Python at all? wtf...
I wonder if Sledge has any clue.
If he comes up with any changes, I'll produce a new build ASAP.
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

Is it time to say this was my belated April Fool's day joke?


:)

No, just kidding. The problem is real but indeed... WTF!!
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

PS: these problems can't possibly be because I hard linked the Download folder from C:\Users\User\Download to my external USB3 disk, right? Right??

Edit:

Code: Select all

PS C:\WINDOWS\system32> $Env:Path
C:\Program Files\Python38\Scripts;C:\Program Files\Python38;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn;C:\Program Files\Microsoft SQL Server\160\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python39\;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps;C:\Users\Gebruiker\AppData\Local\Programs\Microsoft VS Code\bin
PS C:\WINDOWS\system32> Get-ChildItem Env:Path

Name                           Value
----                           -----
Path                           C:\Program Files\Python38\Scripts;C:\Program Files\Python38;C:\Users\Gebruiker\AppDat...


PS C:\WINDOWS\system32> Get-ChildItem Env:Path

Name                           Value
----                           -----
Path                           C:\Program Files\Python38\Scripts;C:\Program Files\Python38;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOW...
A later EDIT:
once Python 3.10 was removed, qB 4.5.5 was stable again despite the initial update freezes. I just updated to 4.6 and all is still good. Not gonna install Python 3.10 again :) UPDATE: not as stable as I hoped...Will continue editing here to update my findings.
Update: frack, it's stable again BUUUUT I lost many big torrents once again!!! Frack! And adding them is a pita... Constant freezes etc. Will see how that goes once I re-added all the URIs. Fracking Python.
Update: re-added the torrents I know I missed. If the freezes now continue it's because qB has problems with big torrents (maybe due to the remaining Python installation I still have - will test)
https://pasteboard.co/WWBcxr58h94U.png
gorgo33
Newbie
Newbie
Posts: 1
Joined: Wed Dec 06, 2023 9:31 am

Re: Missing Python Runtime (search)

Post by gorgo33 »

i found the fix, use the pyton installer from ninite.com, i selected all there, ald the search workt again..

NINITE!!!
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

gorgo33 wrote: Wed Dec 06, 2023 9:33 am i found the fix, use the pyton installer from ninite.com, i selected all there, ald the search workt again..

NINITE!!!
I'll test it on my old PC that had this problem! Thanks!
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

problem after installation of sticky password: qbittorrent​ UI crashes and is non responding

Post by bitcoin »

Hey, I'm back.

I switched to another (identical) PC where qbittorrent didn't have any problems and I've been using search since. I also had no more problems with a lagging non-responding user interface...

BUT today the problem came back: I can still search but sorting on a column crashes QB once again. The only program I had newly installed was Sticky Password manager for Windows. I had that also installed on my old PC. I'm pretty sure StickyPassword is causing the UI not responding problem!

Also see: https://github.com/qbittorrent/qBittorrent/issues/6073

I'm also noticing LOTS of disk reads by QB - more than should be needed for uploading (+100MB/s read actions on disk). This is also happening since I installed SF.

I'll update this thread if I find a way for SF to ignore QB.

Thanks! :)
bitcoin
Member
Member
Posts: 63
Joined: Thu Oct 12, 2023 4:24 pm

Re: Missing Python Runtime (search)

Post by bitcoin »

Update: I told Sticky Password to ignore qbittorrent.exe and sorting columns now works as it should! Sigh. :)

One of these days I'll check my old PC and see if that fixes the search problem there...

Peace!
Post Reply