Closed funderburkjim closed 2 months ago
So, does it mean that Cologne has dropped support for Python2 now?
At command line in terminal at cologne:
> python -i
Python 3.6.8 (default, Jan 5 2024, 08:58:17)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux
> python3 -i
Python 3.6.8 (default, Jan 5 2024, 08:58:17)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux
> python2 -i
Python 2.7.18 (default, Oct 3 2023, 08:47:34)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux2
The above shows that 'python xxx.py' works at the terminal and is same as
'python3 xxx.py'.
In my setup at cologne, at terminal:
> which python
alias python='/usr/bin/python3'
/usr/bin/python3
But the story is slightly different when we run a script. Consider script temp1a.sh:
echo "python --version"
python --version
echo "-----------------------------------------------------"
echo "python3 --version"
python3 --version
echo "-----------------------------------------------------"
echo "python2 --version"
python2 --version
In a terminal, run this script via 'sh temp1a.sh'. The result is
sh temp1a.sh
python --version
temp1a.sh: Zeile 3: python: Kommando nicht gefunden.
-----------------------------------------------------
python3 --version
Python 3.6.8
-----------------------------------------------------
python2 --version
Python 2.7.18
So, in a script 'python ' is unknown!
The use of 'python' command in a script doesn't work.
I examined the various scripts that are used when we generate displays at Cologne (at csl-pywork/v02), and found use of 'python' command only in the script csl-websanlexicon/v02/generate_dict.sh which as mentioned above has been changed to use 'python3'. In all the other scripts, I found that 'python3' command was used.
Why 'python' command fails in scripts is still a mystery to me. But if we use 'python3' to execute code in any new scripts, then we should be ok.
@drdhaval2785 Do you think we should mention this to Cologne webmaster?
It seems that we are only marginally affected. We have explicitly mentioned to use python3 at majority of places. I do not think that we should report to webmaster.
concur. - no mention to webmaster.
A further problem was noticed after #37, during the installation on the cologne server.
Namely, in the csl-websanlexicon/v02/generate_dict.sh script, the 'python' command was not found!
I changed this to 'python3' and script works as expected.
This is no doubt due (somehow) to the recent changes at that server.
I am not sure if there are other instances where 'python' is used and which might cause a problem sometime. Scripts in this csl-websanlexicon repository and in the csl-pywork repository need to be checked.