Install newer version of python 3.10 under CentOS 8

At present, the default version of python under CentOS 8 is Python 3.6.8, which is 6 years old. More and more python software needs newer versions, so it is a vital for pretty stable Linux distro to have an easy way to install newer programming languages like python!
Using Conda it is really easy to manage different environments for different python versions!

Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux.

More on CondaInstalling conda command line in various systems with miniconda and create a simple python environment and all Conda tags – This article is not intended to introduce the reader with Conda, but to show how easy is to install the newer version of python 3.10 under CentOS 8 and it is easy because of using the Conda package management system!

To summarize, the purpose is to have a user with python 3.10. The user can be an ordinary or administrative one or even root.
Using this method older or newer versions of python may be installed on the same machine (at the same time).

STEP 1) Install the latest Miniconda3

The installation is easy and for more details check out the first link above.
Keep on reading!

conda command-line search and install a package in a new environment – tensorflow

Using conda from Anaconda is really easy to install complex environments even like TensorFlow on many different Linux distributions and Windows.
conda utility and its multiple environments guarantee no changes from the package system of the current Linux distribution. Installing operating system updates may break fine-tuned and complex development environments. Installing packages from conda minimizes the OS-related problems and offers the user to use of complex development setups in various Linux distributions like CentOS, Fedora, Manjdaro, Mint, Debian, Ubuntu, Elementary OS with the same command line interface.
Using pip instead of conda may lead to a broken environment after simple OS package updates.

STEP 1) Install conda command line utility.

The install is easy enough, just follow this article – Installing conda command line in various systems with miniconda and create a simple python environment
The conda command-line utility is installed by Miniconda3.

STEP 2) Search for conda packages.

Use the search command to find packages. All available versions are displayed supported for the current installation.
Keep on reading!

conda export environment and conda import environment

conda export and import feature is ideal functionality to build a predefined environment from a list in a text file.
Here are some caveats (or features), which may stumble the user to build a working conda environment list file:

  • There are packages, which are not available for all OS platforms. There are packages, which are only available in Linux platforms and other only under Windows platform!
  • There are package names, followed by version and build version. All three a valid entries in the list file – only the name of the package, the name of the package with version and the name of the package with version and build version. For example,
      - setuptools=58.0.4=py38h06a4308_0
      - sqlite=3.37.0=hc218d9a_0
      - tk=8.6.11
      - wheel
  • Builds’ versions are specific for the OS and they are different for every Operating systems.
  • Packages’ versions do tend to deprecate, so the old environment may not be possible to replicate because of a missing package version. Exported list with version, which are unavailable any more and so it cannot be imported.
  • A good practice is to update the current working environment with the latest updates before exporting it.
  • Export environment list without build versions. Edit the exported environment list if some version is missing. The version of the packages could be removed, too.
  • The exported environment list uses yaml format.

1) Here is the command to export an environment list of a python environment with and without builds and versions of the packages:

  1. With builds versions
    (base) myenv@srv ~ $ conda env export -n mypython37
    name: mypython37
      - defaults
      - _libgcc_mutex=0.1=main
      - _openmp_mutex=4.5=1_gnu
      - ca-certificates=2021.10.26=h06a4308_2
      - certifi=2021.10.8=py37h06a4308_2
      - ld_impl_linux-64=2.35.1=h7274673_9
      - libffi=3.3=he6710b0_2
      - libgcc-ng=9.3.0=h5101ec6_17
      - libgomp=9.3.0=h5101ec6_17
      - libstdcxx-ng=9.3.0=hd4cf53a_17
      - ncurses=6.3=h7f8727e_2
      - openssl=1.1.1m=h7f8727e_0
      - pip=21.2.2=py37h06a4308_0
      - python=3.7.11=h12debd9_0
      - readline=8.1.2=h7f8727e_1
      - setuptools=58.0.4=py37h06a4308_0
      - sqlite=3.37.0=hc218d9a_0
      - tk=8.6.11=h1ccaba5_0
      - wheel=0.37.1=pyhd3eb1b0_0
      - xz=5.2.5=h7b6447c_0
      - zlib=1.2.11=h7f8727e_4
    prefix: /home/myenv/miniconda3/envs/mypython37

    By default, the output is in the console with YAML syntax. There is a JSON option and a file option to output it in a file:
    Keep on reading!

Installing conda command line in various systems with miniconda and create a simple python environment

Conda is yet another package, dependency and environment management for multiple languages like Python, C/C++, JavaScript, Java, Scala and many more
For example, with Conda the user could create python environment with the exact versions he needs! And it could be used under any Linux distribution or even Windows.

This article is to show how to install the command-line version of the Conda, which is part of the bigger platform Anaconda. The command-line version is distributed with the name Miniconda. In fact, Miniconda is a free installer for Conda, which includes only the basic set to run conda and conda install to install more than 8000 packages from the Anaconda repositories.

The Anaconda repositories could be found here:

Advantages of Miniconda:

  1. Minimal installation. 400 Mbytes, not 3G for the Anaconda platform.
  2. simple command-line interface. Couple of simple commands and their instructions are enough to bring up a complex environment for scientific or development purposes.
  3. The creating of a specific environment could be automated.
  4. No strange or not friendly GUI.
  5. Easy installation under most of the Linux distribution and Windows.
  6. The whole installation could occur only under a user’s home directory. No files require to be installed by the administrator or under global administrative path.

Keep on reading!