[petsc-users] Python version needed for internal scripts

Jed Brown jed at jedbrown.org
Wed Oct 14 08:40:43 CDT 2020


Lisandro Dalcin <dalcinl at gmail.com> writes:

> On Wed, 14 Oct 2020 at 13:01, Nicolas Barral <
> nicolas.barral at math.u-bordeaux.fr> wrote:
>
>>
>> 'python' is usually an alias for python2, so making it point at python3
>> seems a bit dangerous. Yet, python2 was removed from recent Ubuntus and
>> maybe others, and if I have no python2 installed, and no 'python' alias,
>> I have to manually edit all the scripts.
>
> apt install python-is-python3
>
> and you should get the alias python -> python3 in /usr/bin

Most scripts are called through the make system, which uses $(PYTHON).  You can always do that:

  /your/preferred/python petsc_gen_xdmf.py thefile.h5


configure is actually a polyglot shell script that figures out how to call Python on itself.  We could do that for other essential scripts.  I hate the workflow of petsc_gen_xdmf.py, but it could be done this way.


My /bin/python (on Arch) has been Python-3 since 2011.


More information about the petsc-users mailing list