No `python` in PATH in recent Linux distros

Issue #373 resolved
Paul Hargrove created an issue

With the EOL for python2, it appears that some Linux distros are now defaulting to installing /usr/bin/python3 without a /usr/bin/python symlink. They then also provide an optional package with /usr/bin/python2, but also without a /usr/bin/python symlink. I can attest first-hand that Ubuntu 20.04 is one distro with this behavior by default.

The net result is that python scripts to be used on such a distro must be explicit about python2 vs python3. UPC++ does not currently match this expectation and configure fails by default:

ERROR: Python interpreter 'python' was not found in $PATH.
Use '--with-python=...' to specify a Python interpreter.

Comments (5)

  1. Paul Hargrove reporter

    The obvious work-around (configure --with-python=python3) works as one would hope.

    However, we can/should do better by looking for python3 or python2 in addition to bare python.

  2. Paul Hargrove reporter

    configure: search PATH for python3 and python2

    This commit resolves issue #373: "No python in $PATH in recent Linux distros" by adding python3 and python2 to the names searched for in $PATH at configure time.

    → <<cset f149db7532f0>>

  3. Log in to comment