Bug 7294 - server installer/tl-setup does not automatically find Python 2.7 on RHEL8
Summary: server installer/tl-setup does not automatically find Python 2.7 on RHEL8
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: trunk
Hardware: PC Linux Red Hat
: P2 Normal
Target Milestone: 4.10.1
Assignee: Peter Åstrand
URL:
Keywords: ossman_tester, relnotes
Depends on:
Blocks: 7328
  Show dependency treegraph
 
Reported: 2018-12-12 10:18 CET by Karl Mikaelsson
Modified: 2019-06-26 13:24 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:
* All parts of the product should refer to "python2"; not "python"


Attachments

Description Karl Mikaelsson cendio 2018-12-12 10:18:33 CET
> # ./install-server 
> 
> Error: No Python 2.x interpreter found.
> 
> A Python 2.x interpreter is required for ThinLinc.
> I was trying to use the Python interpreter named 'python'.
> 
> If Python is installed under a different name, set the PYTHON
> environment variable to the Python binary to use. Example:
> PYTHON=/usr/bin/python2.6 ./install-server
> 
> To install Python, please run this command:
> 
>     dnf install python
> 
> Would you like to run this command now?
> 
> (Y/n)? n
>
> Please try again once Python is installed.
>
> # which python
> /usr/bin/which: no python in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
>
> # which python2
> /usr/bin/python2
>
> # which python2.7
> /usr/bin/python2.7


While you could set PYTHON=/usr/bin/python2.7, it's a rather poor experience. Given that we only support Python 2.6 and 2.7, searching for any of python2.7 python2.6 python2 python would go a long way to get a nicer installation experience.
Comment 1 Peter Åstrand cendio 2019-04-09 09:36:23 CEST
(In reply to comment #0)
> > # ./install-server 
> > 
> > Error: No Python 2.x interpreter found.
> > 
> > A Python 2.x interpreter is required for ThinLinc.
> > I was trying to use the Python interpreter named 'python'.
> > 
> > If Python is installed under a different name, set the PYTHON
> > environment variable to the Python binary to use. Example:
> > PYTHON=/usr/bin/python2.6 ./install-server
> > 
> > To install Python, please run this command:
> > 
> >     dnf install python
> > 
> > Would you like to run this command now?
> > 
> > (Y/n)? n
> >
> > Please try again once Python is installed.
> >
> > # which python
> > /usr/bin/which: no python in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
> >
> > # which python2
> > /usr/bin/python2
> >
> > # which python2.7
> > /usr/bin/python2.7
> 
> 
> While you could set PYTHON=/usr/bin/python2.7, it's a rather poor experience.

Slightly easier:

PYTHON=python2 ./install-server
Comment 2 Peter Åstrand cendio 2019-06-24 10:09:29 CEST
According to https://www.python.org/dev/peps/pep-0394/, we should refer to "python2":

"python2 will refer to some version of Python 2.x."

See also https://blogs.gnome.org/mcatanzaro/2018/02/16/on-python-shebangs/. I believe we should change "python" to "python2" in our setup tools.
Comment 3 Peter Åstrand cendio 2019-06-24 10:13:19 CEST
"python2" is available on RHEL6, Ubuntu 16.04 and SLES12. I believe it should be available on most systems we support. Otherwise, the fallback path with PYTHON=python can be used.
Comment 5 Pierre Ossman cendio 2019-06-25 13:24:19 CEST
Almost. Something goes wrong with the graphical sudo handling. I'm getting the error:

  tl-ssh-askpass: line 15: exec: python: not found
Comment 8 Pierre Ossman cendio 2019-06-26 13:24:33 CEST
Works well now. Tested on RHEL 6, RHEL 8, Fedora 30 and SLES 15.

Note You need to log in before you can comment on or make changes to this bug.