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

python vs python3 in ./utils/brand.sh on Debian #3235

Open
altercat10n opened this issue Feb 20, 2024 · 4 comments
Open

python vs python3 in ./utils/brand.sh on Debian #3235

altercat10n opened this issue Feb 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@altercat10n
Copy link

Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG

2024.2.18+76845ea42
commit 76845ea
master branch, no fork

How did you install SearXNG?

sudo -H ./utils/searxng.sh install all

What happened?

The installation script ./utils/searxng.sh uses the script ./utils/brand.sh which results in the following errors on Debian 12 Bookworm:

…/searxng/utils/brand.sh: line 19: python: command not found
…/searxng/utils/brand.sh: line 20: python: command not found
…/searxng/utils/brand.sh: line 21: python: command not found

Installation and update appear to work nonetheless.

How To Reproduce

Install SearXNG with sudo -H ./utils/searxng.sh install all on Debian 12 Bookworm.

Expected behavior

No error messages. Correct Python path and version used and script executed without problems.

Additional context

Debian does not use /usr/bin/python by default since some versions ago, but /usr/bin/python3. But python is hard coded in the shell script, not python3.

Debian users can fix this easily by installing package python-is-python3 (sudo apt install python-is-python3), which installs a symlink /usr/bin/python -> python3.

Debian users should at least be advised to install package python-is-python3 in SearXNG documentation.

Ideally, shell scripts should automatically determine correct Python version and path to use.

@altercat10n altercat10n added the bug Something isn't working label Feb 20, 2024
@return42
Copy link
Member

Install SearXNG with sudo -H ./utils/searxng.sh install all on Debian 12 Bookworm.

can't believe debian 12 ships python 2 -->

Debian provides the latest stable Python 3 release; it also provides the latest stable Python 2 release, but Python 2 is unsupported by the Python Foundation since 2020-01-01 and is being removed as of Debian 11 (Bullseye) --> https://www.debian.org/News/2021/20210814

Ideally, shell scripts should automatically determine correct Python version and path to use.

Its a uncommon case on old LTS distros ..

@altercat10n
Copy link
Author

Install SearXNG with sudo -H ./utils/searxng.sh install all on Debian 12 Bookworm.

can't believe debian 12 ships python 2

You are correct, it does not in current versions, as Debian 12 Bookworm.

Its a uncommon case on old LTS distros ..

This is not true. The common case in current Debian distributions is:

With the switch to Python 3, Debian 11 Bullseye (currently “oldstable”) and Debian 12 Bookworm (currently “stable”) do not use /usr/bin/python, but /usr/bin/python3. That is, using the command python in current Debian versions results in an error, as python3 should have been used.

Unless the user manually installed the package python-is-python3, which is not installed by default; but which should be advised if the shell scripts are not going to be adapted.


NOTE: Debian 11 (bullseye) has removed the "python" package and the '/usr/bin/python' symlink due to the deprecation of Python 2. No packaged scripts should depend on the existence of '/usr/bin/python': if they do, that is a bug that should be reported to Debian. You can use the 'python-is-python3' or 'python-is-python2' packages to restore an appropriate '/usr/bin/python' symlink for third-party or legacy scripts.

https://wiki.debian.org/Python#Python_in_Debian

@return42 return42 reopened this Feb 20, 2024
@Sailing74
Copy link

Thanks for this. Just came across the same issue trying to install searxng on debian 12. Installing python-is-python3 fixes things.

@un99known99
Copy link

worked for me as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants