From: Jacob Hrbek <kreyren@rixotstudio.cz>
To: 53334@debbugs.gnu.org
Subject: bug#53334: qbittorrent(<=4.4.0)'s search window fails with "Python is required to use the search engine but it does not seem to be installed"
Date: Tue, 18 Jan 2022 03:00:12 +0000 [thread overview]
Message-ID: <43f27323-66b8-d72b-9ab5-062c5a27a72b@rixotstudio.cz> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 4021 bytes --]
qbittorrent <=4.4.0 (current latest version) fails with:
```
Missing Python Runtime
Python is required to use the search engine but it does not seem to be
installed
```
which is triggered from `qbittorrent/src/gui/mainwindow.cpp`:
```cpp
/*https://github.com/qbittorrent/qBittorrent/blob/00f6bb7c8225285a7929426187a1513d247b582b/src/gui/mainwindow.cpp#L1847 */
void MainWindow::on_actionSearchWidget_triggered()
{
if (!m_hasPython && m_ui->actionSearchWidget->isChecked())
{
const Utils::ForeignApps::PythonInfo pyInfo = Utils::ForeignApps::pythonInfo();
// Not installed
if (!pyInfo.isValid())
{
m_ui->actionSearchWidget->setChecked(false);
Preferences::instance()->setSearchEnabled(false);
#ifdef Q_OS_WIN
const QMessageBox::StandardButton buttonPressed = QMessageBox::question(this, tr("Missing Python Runtime")
, tr("Python is required to use the search eng
ine but it does not seem to be installed.\nDo you want to install it now?")
, (QMessageBox::Yes | QMessageBox::No), QMessageBox::Yes);
if (buttonPressed == QMessageBox::Yes)
installPython();
#else
QMessageBox::information(this, tr("Missing Python Runtime")
, tr("Python is required to use the search engine but it does not seem to be installed."));
#endif
return;
}
// Check version requirement
if (!pyInfo.isSupportedVersion())
{
m_ui->actionSearchWidget->setChecked(false);
Preferences::instance()->setSearchEnabled(false);
#ifdef Q_OS_WIN
const QMessageBox::StandardButton buttonPressed = QMessageBox::question(this, tr("Old Python Runtime")
, tr("Your Python version (%1) is outdated. Minimum requirement: %2.\nDo you want to install a newer version now?")
.arg(pyInfo.ve
rsion, QLatin1String("3.5.0"))
, (QMessageBox::Yes | QMessageBox::No), QMessageBox::Yes);
if (buttonPressed == QMessageBox::Yes)
installPython();
#else
QMessageBox::information(this, tr("Old Python Runtime")
, tr("Your Python version (%1) is outdated. Please upgrade to latest version for search engines to work.\nMinimum requirement: %2.")
.arg(pyInfo.version, QLatin1String("3.5.0")));
#endif
return;
}
m_hasPython = true;
m_ui->actionSearchWidget->setChecked(true);
Preferences::instance()->setSearchEnabled(true);
}
displaySearchTab(m_ui->actionSearchWidget->isChecked());
}
```
To call `Utils::ForeignApps::pythonInfo()` definition in
`qbittorrent/src/base/utils/foreignapps.cpp` as:
```cpp
/*https://github.com/qbittorrent/qBittorrent/blob/5c0378a6845e3484023f4c76893ff9f0e5178460/src/base/utils/foreignapps.c
pp#L272 */
PythonInfo Utils::ForeignApps::pythonInfo()
{
static PythonInfo pyInfo;
if (!pyInfo.isValid())
{
if (testPythonInstallation("python3", pyInfo))
return pyInfo;
if (testPythonInstallation("python", pyInfo))
return pyInfo;
#if defined(Q_OS_WIN)
if (testPythonInstallation(findPythonPath(), pyInfo))
return pyInfo;
#endif
LogMsg(QCoreApplication::translate("Utils::ForeignApps", "Python not detected"), Log::INFO);
}
return pyInfo;
}
```
Where:
```cpp
if (testPythonInstallation("python3", pyInfo)) ...
```
Is important as it's checking for a `python3` (or `python`) executable
in PATH that is not provided by guix's build procedure -> The package
has compatibility issues with GNU Guix and has to be patched.
### Steps to reproduce:
0. Get qbittorrent on GNU Guix
1. Open the GUI: View > Search engine and observe the highlighted error
pre
venting to use the search engine functionality
Relevants:
R1. https://github.com/qbittorrent/qBittorrent/issues/16139
--
Jacob Hrbek
[-- Attachment #1.1.2: Type: text/html, Size: 5177 bytes --]
[-- Attachment #1.2: publickey - kreyren@rixotstudio.cz - 1677db82.asc --]
[-- Type: application/pgp-keys, Size: 713 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
next reply other threads:[~2022-01-18 3:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 3:00 Jacob Hrbek [this message]
[not found] ` <handler.53334.B.164247484129040.ack@debbugs.gnu.org>
2022-01-18 3:01 ` bug#53334: Acknowledgement (qbittorrent(<=4.4.0)'s search window fails with "Python is required to use the search engine but it does not seem to be installed") Jacob Hrbek
2022-01-19 7:15 ` Jacob Hrbek
2022-01-18 3:16 ` bug#53334: [PATCH] qbittorrent: Phase patch to use full nix path for python-gate to avoid "Missing Python Runtime" failure on search engine Jacob Hrbek
2022-01-18 9:53 ` bug#53334: (No Subject) Attila Lendvai
2022-02-27 9:09 ` bug#53334: Acknowledgement (qbittorrent(<=4.4.0)'s search window fails with "Python is required to use the search engine but it does not seem to be installed") Jacob Hrbek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43f27323-66b8-d72b-9ab5-062c5a27a72b@rixotstudio.cz \
--to=kreyren@rixotstudio.cz \
--cc=53334@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.