Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.0.0beta: Python Runtime can't be found despite manually setting the Python path #20737

Closed
realdevnullius opened this issue Apr 20, 2024 · 47 comments
Labels
Not an issue User error, problem unrelated to qBittorrent, feature already implemented, etc Search engine Issues related to the search engine/search plugins functionality

Comments

@realdevnullius
Copy link

realdevnullius commented Apr 20, 2024

qBittorrent & operating system versions

qBittorrent: 5.0.0 beta 1, LT20, x64
Operating system: Windows 11 (10.0.22631)
Qt: 6

What is the problem?

This issue is hunting me on 1 PC for the longest time...

In regards to version 4: https://forum.qbittorrent.org/viewtopic.php?t=11055
In regards to version 5: https://forum.qbittorrent.org/viewtopic.php?t=11409

No matter what we tried, qBittorrent just won't find ANY Python installed, ever. And yes, I think I tried it all and that's why I went to v5 beta in the hopes that manually setting the Python path (finally!) would fix my issue.

It did not. So I made a bug report. Screenshots, steps taken, etc. are all in the forum threads.

Steps to reproduce

No steps, it always fails no matter what I try.

Additional context

See forum links please

Log(s) & preferences file(s)

I have no settings file I can upload. All I found were:
qbittorrent.ini
qbittorrent-data.ini
(empty) watched_folders.json
categories.json and an RSS folder.

I doubt there's anything of interest in it.

I have not been able to find a log file, though I posted console logs to the forum threads.

@realdevnullius realdevnullius changed the title v5.0.0beta: Not working: Missing Python Runtime (search): despite manually setting the Python path (per Allow users to specify Python executable path #19644) Python cannot be found by qBittorrent v5.0.0beta: Not working: Missing Python Runtime (search): despite manually setting the Python path (per Allow users to specify Python executable path #19644), Python cannot be found by qBittorrent Apr 20, 2024
@realdevnullius realdevnullius changed the title v5.0.0beta: Not working: Missing Python Runtime (search): despite manually setting the Python path (per Allow users to specify Python executable path #19644), Python cannot be found by qBittorrent v5.0.0beta: Not working: Missing Python Runtime (search): despite manually setting the Python path (per "Allow users to specify Python executable path #19644"), Python cannot be found by qBittorrent Apr 20, 2024
@Chocobo1
Copy link
Member

You need to put the full path to python.exe in the "Python executable path" option. For example: C:\python_dir\python.exe

@realdevnullius
Copy link
Author

realdevnullius commented Apr 20, 2024

You need to put the full path to python.exe in the "Python executable path" option. For example: C:\python_dir\python.exe

Thank you for catching that one.

Entering the full path, including the python.exe executable, DID NOT fix the problem.

qBT 4 and 5 still ask to install Python themselves, but after doing so it will still not find python.exe. Even worse, v5 is now constantly freezing and not responding at all (despite having qBittorrent.exe excluded from Sticky Password in its program settings)

Thank you!

https://snipboard.io/ls8uST.jpg

ls8uST

https://snipboard.io/GplZoh.jpg

GplZoh

`C:\Users\Gebruiker>python --version
Python 3.10.11

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

From the LOG:
20-4-2024 13:46 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\python.exe".

@Chocobo1
Copy link
Member

Entering the full path, including the python.exe executable, DID NOT fix the problem.

It indicates one thing: qbt couldn't access the executable for unknown reasons. Could be insufficient permission or something is blocking the access.

For the record, I couldn't reproduce the issue, it works for me.

@realdevnullius
Copy link
Author

What reasons could there be? Running qBT as an admin makes no change. Disabling Avast AV makes no difference either. The OS finds it just fine, so does the installer used by qBT. But once it's installed, somehow qBT just can't see it. What else to look at? :(

@Balls0fSteel
Copy link

Try downloading a the "Embeddable package" from Python's website @realdevnullius . Extract it to like to your Documents folder (something writable, accessible) and give that .exe path to qB.

@realdevnullius
Copy link
Author

realdevnullius commented May 5, 2024

Downloaded and extracted the embedded zip file to:
D:\python-3.12.3-embed-amd64

I entered that path statement in qB ("D:\python-3.12.3-embed-amd64\python.exe").

I restarted qB and clicked View...

Again, an installer prompt appears telling me that Python is not installed. Like, how!!? :( I just can't figure this out. Someone even built a custom qB 4 wallet with more log notifications but even that didn't teach us anything new. It just won't work on this specific PC :(

The installation prompt will run each time and the installer itself will recognize Python already installed and is done rather quickly (nothing to do!).

https://forum.qbittorrent.org/viewtopic.php?p=41675#p41675

@realdevnullius
Copy link
Author

I also did this: #20392 (comment) (including 2 PC reboots and an uninstall with IObit Uninstaller). As expected: qB keeps behaving the same: Python is not found. It's maddening I tell ya!

@xavier2k6
Copy link
Member

xavier2k6 commented May 5, 2024

@realdevnullius Are you running Windows 11 via parallels desktop on mac or any other VM?

What does python --version display via command prompt? Just noticed it, in previous comment.

@realdevnullius
Copy link
Author

@xavier2k6 thanks for the question: no, just regular Windows 11 on a regular Intel PC.

@xavier2k6
Copy link
Member

@realdevnullius Under "Manage App Execution Aliases" Are python.exe / python3.exe on or off?

When installing did you select "Add Python 3.x to PATH"?

@glassez
Copy link
Member

glassez commented May 6, 2024

When installing did you select "Add Python 3.x to PATH"?

Author did set it in qBittorrent
preferences as absolute path so PATH variable doesn't matter.

@xavier2k6
Copy link
Member

Edited #20737 (comment) to add images via github in case those links go down.

@realdevnullius
Copy link
Author

realdevnullius commented May 7, 2024

@realdevnullius Under "Manage App Execution Aliases" Are python.exe / python3.exe on or off?

When installing did you select "Add Python 3.x to PATH"?

PATH:
No, and as mentioned it wouldn't be necessairy. But I did all those things when troubleshooting v4. It made no difference. Thanks!

C:\Windows\System32>echo %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:\Program Files\dotnet\;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

App Execution aliases qbittorrent

@Terafugia
Copy link

Still open? Come on! Let's see some movement on this issue.

@thalieht thalieht added the Search engine Issues related to the search engine/search plugins functionality label May 21, 2024
@xavier2k6
Copy link
Member

@realdevnullius What version & build of Windows 11 is this?

Do you install python through the Microsoft store?

Have you ran sfc /scannow in an elevated command prompt?

Skimming through the forum posts, it looks like you made modifications to the windows registry as well no?

@xavier2k6 xavier2k6 changed the title v5.0.0beta: Not working: Missing Python Runtime (search): despite manually setting the Python path (per "Allow users to specify Python executable path #19644"), Python cannot be found by qBittorrent v5.0.0beta: Python Runtime can't be found despite manually setting the Python path May 21, 2024
@realdevnullius
Copy link
Author

realdevnullius commented May 23, 2024

Registry was a desperate experiment after which I cleaned up again.

sfc etc are clean. It's Windows 11 but I have this problem for quite a long time by now so it's not the build version at fault. Remember, I had the problem with v4 too! I just hoped that the path option in v5 would finally fix it. It didn't.

Edition	Windows 11 Pro
Version	23H2
Installed on	‎23-‎1-‎2023
OS build	22631.3593
Experience	Windows Feature Experience Pack 1000.22700.1003.0
C:\Windows\System32>sfc /scannow

Beginning system scan.  This process will take some time.

Beginning verification phase of system scan.
Verification 100% complete.

Windows Resource Protection did not find any integrity violations.

Windows Store: while I hate it and didn't think I'd have tried that, apparently I have:
image

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

The installer, called upon by qB, recognizes Python is already installed and exits again with nothing to do.

I'm open to suggestions once more! :)

@xavier2k6
Copy link
Member

@realdevnullius

  1. Uninstall any & all Python versions associated with the "Microsoft Store" (Might be best to reboot after this)
  2. Download https://www.python.org/ftp/python/3.12.3/python-3.12.3-amd64.exe
  3. Select "Add Python 3.x to PATH" when installing
  4. Open qBittorrent now & post logs.

@realdevnullius
Copy link
Author

realdevnullius commented May 23, 2024

It'll fail but I'll do it - I'll edit this post in, say, 10 minutes time with the results.

First edit:
image
image
image

Second edit, after the reboot and downloading 3.12.3:
image
image
And just to make sure I have all my bases covered... I'll run the setup once more, this time not as an admin (why is that option even there?). Which presented me with the repair / uninstall options instead, because yes; Python is installed.

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

Same results for admin cmd prompt and user cmd prompt.

Starting qB and Search... gives:
image
A new Python gets installed:
image

In qB: Search Engine gives... You guessed it:
image
image

Welcome to my world? Sigh :)

@xavier2k6
Copy link
Member

@realdevnullius I didn't want you to install any other version when prompted (I should've made that clear/selecting no was the preferred option)

Can you post the new logs?

Can you post a screenshot of command prompt when you issue py -0p?

@realdevnullius
Copy link
Author

realdevnullius commented May 23, 2024

@realdevnullius

  1. Uninstall any & all Python versions associated with the "Microsoft Store" (Might be best to reboot after this)
  2. Download https://www.python.org/ftp/python/3.12.3/python-3.12.3-amd64.exe
  3. Select "Add Python 3.x to PATH" when installing
  4. Open qBittorrent now & post logs.

Done!

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

Logs:

23-5-2024 20:39 - Failed to find Python executable. Path: "D:\python-3.12.3-embed-amd64\python.exe".
23-5-2024 20:38 - Failed to find Python executable. Path: "D:\python-3.12.3-embed-amd64\python.exe".
23-5-2024 20:38 - Failed to find Python executable. Path: "D:\python-3.12.3-embed-amd64\python.exe".
23-5-2024 20:37 - Failed to find Python executable. Path: "D:\python-3.12.3-embed-amd64\python.exe".
23-5-2024 20:33 - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Thu May 2 07:39:38 2024.
23-5-2024 20:33 - Detected external IP. IP: "143.178.130.71"
23-5-2024 20:33 - Successfully listening on IP. IP: "::1". Port: "UTP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "::1". Port: "TCP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "fe80::a2b:bed1:fa4d:f7d7%6". Port: "UTP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "fe80::a2b:bed1:fa4d:f7d7%6". Port: "TCP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "fe80::ecf3:d8cb:1a74:1203%20". Port: "UTP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "fe80::ecf3:d8cb:1a74:1203%20". Port: "TCP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "127.0.0.1". Port: "UTP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "127.0.0.1". Port: "TCP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "192.168.56.1". Port: "UTP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "192.168.56.1". Port: "TCP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "10.0.0.206". Port: "UTP/11457"
23-5-2024 20:33 - Successfully listening on IP. IP: "10.0.0.206". Port: "TCP/11457"
23-5-2024 20:33 - UPnP/NAT-PMP support: ON
23-5-2024 20:33 - Encryption support: ON
23-5-2024 20:33 - Anonymous mode: OFF
23-5-2024 20:33 - Peer Exchange (PeX) support: ON
23-5-2024 20:33 - Local Peer Discovery support: ON
23-5-2024 20:33 - Distributed Hash Table (DHT) support: ON
23-5-2024 20:33 - HTTP User-Agent: "qBittorrent/5.0.0beta1"
23-5-2024 20:33 - Peer ID: "-qB5000-"
23-5-2024 20:33 - Trying to listen on the following list of IP addresses: "0.0.0.0:11457,[::]:11457"
23-5-2024 20:33 - Using config directory: C:\Users\Gebruiker\AppData\Roaming\qBittorrent
23-5-2024 20:33 - qBittorrent v5.0.0beta1 started. Process ID: 19300

D: is being set by qB 5. I'll change that to a new path and restart qB:
C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps\python.exe

Which gives, after View... Search... and a new setup routine by qB (which detects the existing Python installation so basicly does nothing)...

23-5-2024 20:50 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps\python.exe".
23-5-2024 20:50 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps\python.exe".

BUT... Checking if C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps\python.exe exists... the answer is NO!

C:\Windows\System32>C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\python.exe
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z


C:\Windows\System32>C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

So I changed the path in qB to:
C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe
image

Which MAKES qB NON RESPONDING AGAIN! Like the bug I had with Sticky Password...
image
image

I'll post the new log in a reply once qB starts responding again... Sigh!!

image

@realdevnullius
Copy link
Author

realdevnullius commented May 23, 2024

23-5-2024 20:59 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:59 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:59 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:59 - System wake-up event detected. Re-announcing to all the trackers...
23-5-2024 20:58 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP[192.168.56.1]: no router found"
23-5-2024 20:58 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP[192.168.56.1]: no router found"
23-5-2024 20:57 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:55 - Options saved.
23-5-2024 20:55 - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Thu May 2 07:39:38 2024.

After closing Sticky Password:

23-5-2024 21:02 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 21:02 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:59 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:59 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:59 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:59 - System wake-up event detected. Re-announcing to all the trackers...
23-5-2024 20:58 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP[192.168.56.1]: no router found"
23-5-2024 20:58 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP[192.168.56.1]: no router found"
23-5-2024 20:57 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 20:55 - Options saved.
23-5-2024 20:55 - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Thu May 2 07:39:38 2024.

Restarted qB, tried another View... Got this log:

23-5-2024 21:05 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 21:05 - Failed to find Python executable. Path: "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe".
23-5-2024 21:05 - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Thu May 2 07:39:38 2024.

@xavier2k6
Copy link
Member

xavier2k6 commented May 23, 2024

Python executable path (may require restart)

Leave this empty/clear it & close qBittorrent.....make sure it's fully closed before reopening, do not install any other version if prompted & also post these logs.

Can you post a screenshot of command prompt when you issue py -0p?

@realdevnullius
Copy link
Author

realdevnullius commented May 23, 2024

> `Python executable path (may require restart)`
> 
> Leave this empty/clear it & close qBittorrent.....make sure it's fully closed before reopening
> 
> > Can you post a screenshot of command prompt when you issue `py -0p`?

Already tested the validity of the 2 installations. But thanks and here you go:

C:\Windows\System32>py -0p
 -V:3.12 *        C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\python.exe
 -V:3.10          C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\python.exe

Emptying the option to (blank) does not fix it either.
image

Log after qB restart:

23-5-2024 21:16 - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Thu May 2 07:39:38 2024.
24-5-2024 00:25 - System wake-up event detected. Re-announcing to all the trackers...
23-5-2024 21:27 - System wake-up event detected. Re-announcing to all the trackers...
23-5-2024 21:23 - System wake-up event detected. Re-announcing to all the trackers...
23-5-2024 21:20 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP[192.168.56.1]: no router found"
23-5-2024 21:20 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP[192.168.56.1]: no router found"
23-5-2024 21:17 - Failed to find Python executable
23-5-2024 21:17 - Failed to find `python` executable in Windows Registry.
23-5-2024 21:17 - Failed to find `python` executable in PATH environment variable. 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:\Program Files\dotnet\;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\Python312\Scripts\;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\;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;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38;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;"
23-5-2024 21:16 - Failed to find `python3` executable in PATH environment variable. 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:\Program Files\dotnet\;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\Python312\Scripts\;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\;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;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38;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;"
23-5-2024 21:16 - Failed to find Python executable
23-5-2024 21:16 - Failed to find `python` executable in Windows Registry.
23-5-2024 21:16 - Failed to find `python` executable in PATH environment variable. 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:\Program Files\dotnet\;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\Python312\Scripts\;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\;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;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38;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;"
23-5-2024 21:16 - Failed to find `python3` executable in PATH environment variable. 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:\Program Files\dotnet\;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\Python312\Scripts\;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python312\;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;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38;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;"

@xavier2k6
Copy link
Member

@realdevnullius Is this the only machine you are having issue with?

@realdevnullius
Copy link
Author

@realdevnullius Is this the only machine you are having issue with?

yes

@xavier2k6
Copy link
Member

@realdevnullius Is this the only machine you are having issue with?

yes

I'd say nuke it & start again, in your recent screenshots it seems to show 22621.ni_release.220506-1250 which was an insiders build so there probably is other issues too.

@xavier2k6
Copy link
Member

BTW: the not responding/freezing issue for beta1 is known & was posted on our main site.

KNOWN ISSUE for v5.0.0beta1: When the Preferences dialog is closed the GUI freezes for several seconds.

@realdevnullius
Copy link
Author

Updated my reply #20737 (comment)

@realdevnullius
Copy link
Author

BTW: the not responding/freezing issue for beta1 is known & was posted on our main site.

KNOWN ISSUE for v5.0.0beta1: When the Preferences dialog is closed the GUI freezes for several seconds.

Nah, this is a different one. I had it before, turned out to be Sticky Pwd but I closed that AND I had qB executable excluded... No idea wtf is going on there :)

@realdevnullius
Copy link
Author

@realdevnullius Is this the only machine you are having issue with?

yes

I'd say nuke it & start again, in your recent screenshots it seems to show 22621.ni_release.220506-1250 which was an insiders build so there probably is other issues too.

I haven't found any other issues... Just qB :)

@glassez
Copy link
Member

glassez commented May 24, 2024

@Chocobo1, @qbittorrent/bug-handlers
I believe there's a problem in this user's environment preventing qBittorrent from detecting python. Nevertheless, it would be nice to have more detailed log messages in order to diagnose such problems.

@realdevnullius
Copy link
Author

@Chocobo1, @qbittorrent/bug-handlers I believe there's a problem in this user's environment preventing qBittorrent from detecting python. Nevertheless, it would be nice to have more detailed log messages in order to diagnose such problems.

The forum actually made a custom version with extra logging for me (v4). It showed nothing.

@glassez
Copy link
Member

glassez commented May 24, 2024

@realdevnullius
Could you apply the following settings and add some torrent to see of how does it work?
000

Note that you should change python3 with full path to your python executable unless it is in the PATH.

@realdevnullius
Copy link
Author

realdevnullius commented May 26, 2024

@realdevnullius Could you apply the following settings and add some torrent to see of how does it work?

Note that you should change python3 with full path to your python executable unless it is in the PATH.

There's no Python3.exe on my system: that would assume Python was installed through the App Store, no?

image

Microsoft Windows [Version 10.0.22631.3593]
(c) Microsoft Corporation. All rights reserved.

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

C:\Windows\System32>where python3
C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps\python3.exe

So I'll use C:\Users\Gebruiker\AppData\Local\Programs\Python\Python310\python.exe instead
image

I downloaded an official torrent file for Bit Che but nothing happens. The torrent isn't added either.

@xavier2k6 xavier2k6 added the Not an issue User error, problem unrelated to qBittorrent, feature already implemented, etc label Aug 19, 2024
@realdevnullius
Copy link
Author

User error? Not an issue? lmao... sure!

@xavier2k6
Copy link
Member

User error? Not an issue? lmao... sure!

As pointed out, there's something wrong with your environment on that machine & I don't believe that you ran the command correctly previously.

@HanabishiRecca
Copy link
Contributor

HanabishiRecca commented Oct 1, 2024

I have a guess that this test fails for some reason.

if (testPythonInstallation(preferredPythonPath, pyInfo))
return pyInfo;
LogMsg(QCoreApplication::translate("Utils::ForeignApps", "Failed to find Python executable. Path: \"%1\".")
.arg(preferredPythonPath), Log::WARNING);

bool testPythonInstallation(const QString &exeName, PythonInfo &info)
{
info = {};
QProcess proc;
proc.start(exeName, {u"--version"_s}, QIODevice::ReadOnly);
if (proc.waitForFinished() && (proc.exitCode() == QProcess::NormalExit))
{
QByteArray procOutput = proc.readAllStandardOutput();
if (procOutput.isEmpty())
procOutput = proc.readAllStandardError();
procOutput = procOutput.simplified();
// Software 'Anaconda' installs its own python interpreter
// and `python --version` returns a string like this:
// "Python 3.4.3 :: Anaconda 2.3.0 (64-bit)"
const QList<QByteArrayView> outputSplit = Utils::ByteArray::splitToViews(procOutput, " ", Qt::SkipEmptyParts);
if (outputSplit.size() <= 1)
return false;
// User reports: `python --version` -> "Python 3.6.6+"
// So trim off unrelated characters
const auto versionStr = QString::fromLocal8Bit(outputSplit[1]);
const int idx = versionStr.indexOf(QRegularExpression(u"[^\\.\\d]"_s));
const auto version = PythonInfo::Version::fromString(versionStr.left(idx));
if (!version.isValid())
return false;
info = {exeName, version};
LogMsg(QCoreApplication::translate("Utils::ForeignApps", "Found Python executable. Name: \"%1\". Version: \"%2\"")
.arg(info.executableName, info.version.toString()), Log::INFO);
return true;
}
return false;
}

@xavier2k6
Copy link
Member

There's no space between python.exe & --version, unsure if that makes a difference, just something I noticed in provided screenshot.

@Mike-Litoreece
Copy link

This is NOT a user problem.

I havea windows 11 machine and it worked on the same day until I was prompted to update Qubitttorent. Then I updated QBT and then all of a sudden search plugins dissappeared

This is a Qubittorrent 5.0.0 problem — or else something wrong with python 3.12, both of which are the latest versions but the Qbittorent is the newer thing here. So that's where the problem lies in my opinion.

@xavier2k6
Copy link
Member

@Mike-Litoreece this issue is different to what you are experiencing!

@xavier2k6
Copy link
Member

@realdevnullius Install v5.0.0 official build now & use a supported release of OS & not "insiders build" - 24H2 is also out now too.

@Suncatcher
Copy link

Suncatcher commented Oct 6, 2024

Somewhat related to the issue, I noticed following lines in the QB log:

(I) 2024-10-01T08:01:25 - Failed to find `python3` executable in PATH environment variable. PATH: "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 (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\user\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\user\AppData\Local\Programs\Python\Python312\;C:\Users\user\AppData\Local\Microsoft\WindowsApps;"
(I) 2024-10-01T08:01:25 - Found Python executable. Name: "python". Version: "3.12.6"

For me searching for python3 is useless, as the modern 3.0+ python installations versions sit behind the python command.
Python3 command is outdated, it was actual in the times of transition from 2x to 3x, which is now mostly over for all the developers and the python2 became obsolete.
Pay attention to PEP394, which clearly stress out this moment:

While far from being universally available, python remains the preferred spelling for explicitly invoking Python

Also, pay attention to:
python/cpython#98761
msys2/MINGW-packages#4950
python/peps#989

This is a consensus among Python maintainers, nobody uses python3 spelling anymore.

@vardecab
Copy link

vardecab commented Oct 8, 2024

Having the same issue on macOS after updating to qBittorrent 5.0. Everything worked perfectly before, but after updating to version 5.0, qBittorrent suddenly can’t detect Python, even though it’s obviously installed.

@xavier2k6
Copy link
Member

@vardecab There have been issues identified with users using python 3.8.10 & also with an unofficial plugin.

  1. Uninstall any other previous python versions & install python 3.13 for macOS
  2. Always ty to ensure you install stand-alone python & not through homebrew.

@xavier2k6
Copy link
Member

@Chocobo1 FYI -> #20737 (comment)

@xavier2k6
Copy link
Member

Closing!

  1. No further feedback from OP
  2. Ticket was opened for a "beta" build
  3. User is using an unsupported OS "Insiders build"

Make sure you are using qBittorrent on a supported platform. Do not submit issues which can only be reproduced on beta/unsupported releases of supported operating systems (e.g. Windows 10 Insider, Ubuntu 12.04 LTS, etc). These are unstable/unsupported platforms, and in all likelihood, whatever the issue is, it is not related to qBittorrent.

https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md#steps-to-ensure-a-good-bug-report

Please update to latest qBittorrent 5.0.0 ATTOW & If any issues are experienced on a supported system, please open a new ticket.

@xavier2k6 xavier2k6 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
@joopbraak
Copy link

Some things I noticed from what realdevnullius posted:

  • He still had the embedded python version on the D: drive in the qB settings although he said he changed the path already.
  • After supposedly uninstalling Python from the f*king windows store, the executables where still showing up in the C:\Users\Gebruiker\AppData\Local\Microsoft\WindowsApps directory. Get rid of them through the command line, I say.
  • He had (next to the Python version he apparently already installed through the Windows store) version 3.10 and 3,12 installed, so three different versions of Python.
  • I don't know what that sticky whatever program has got to do with it.

Conclusion, he made a mess of his PC and only complicated things. For you developers to spend so much time on this is a waste of time and resources, which are scarce already. Just my advise.
Al least, next time, first ask somebody to completely clean his or her machine from all Python traces, also in the registry.
Watch out if there are other programs installed that use Python, like LibreOffice.
Let the user open a command prompt, type:
dir /a/s C:python*.exe
and the output of path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not an issue User error, problem unrelated to qBittorrent, feature already implemented, etc Search engine Issues related to the search engine/search plugins functionality
Projects
None yet
Development

No branches or pull requests