Python 3.9 : Install2021/08/02 |
Install Python 3.9.
|
|
[1] | It's possible to install Python 3.9 from AppStream. |
[root@dlp ~]# dnf module -y install python39 Dependencies resolved. ========================================================================================== Package Arch Version Repo Size ========================================================================================== Installing group/module packages: python39 x86_64 3.9.2-1.module+el8.4.0+574+843c4898 appstream 31 k Installing dependencies: python39-libs x86_64 3.9.2-1.module+el8.4.0+574+843c4898 appstream 8.1 M python39-pip-wheel noarch 20.2.4-3.module+el8.4.0+574+843c4898 appstream 1.3 M python39-setuptools-wheel noarch 50.3.2-3.module+el8.4.0+574+843c4898 appstream 496 k Installing weak dependencies: python39-pip noarch 20.2.4-3.module+el8.4.0+574+843c4898 appstream 2.0 M python39-setuptools noarch 50.3.2-3.module+el8.4.0+574+843c4898 appstream 870 k Installing module profiles: python39/common Enabling module streams: python39 3.9 Transaction Summary ========================================================================================== Install 6 Packages ..... .....[root@dlp ~]# python3 -V Python 3.9.2 # verify to create test script [root@dlp ~]# echo -e "import sys\nprint(sys.version)" > python3_test.py [root@dlp ~]# python3 python3_test.py 3.9.2 (default, Jun 11 2021, 17:22:26) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] |
[2] | If you installed multiple version of Python 3, it's possible to switch them with [alternatives]. |
[root@dlp ~]# alternatives --config python3
There are 3 programs which provide 'python3'.
Selection Command
-----------------------------------------------
* 1 /usr/bin/python3.6
+ 2 /usr/bin/python3.8
3 /usr/bin/python3.9
Enter to keep the current selection[+], or type selection number: 3
[root@dlp ~]# python3 -V Python 3.9.2 |
[3] | If you'd like to use [python] command which does not have version number, it's possible to switch them with [alternatives]. |
[root@dlp ~]# alternatives --config python
There are 5 programs which provide 'python'.
Selection Command
-----------------------------------------------
*+ 1 /usr/libexec/no-python
2 /usr/bin/python3
3 /usr/bin/python2
4 /usr/bin/python3.8
5 /usr/bin/python3.9
Enter to keep the current selection[+], or type selection number: 5
[root@dlp ~]# python -V Python 3.9.2 |
Sponsored Link |
|