Install Python 3.12 in CentOS 7 with SCL

In the previous post, I documented my attempt to install Python 3.12 on my CentOS 7, which ended in failure due to compilation errors. After an extensive search, I identified the issue as an outdated version of gcc, with CentOS 7 using gcc 4.8.5 while the latest version is gcc 13. Upgrading gcc to the latest version in CentOS proved challenging, but Software Collections (SCL) offered a potential solution. Given the considerable time investment required, I didn’t proceed with the SCL installation and experimentation. This post is motivated by that decision. I will explore SCL in this post, aiming to successfully run Python 3.12 with the assistance of SCL.

Read more

Get File List of Dataset from Huggingface without Downloading Data

Hugging Face is both a platform and a community focused on machine learning, particularly in the areas of natural language processing (NLP), computer vision, and audio processing. It is often referred to as the “GitHub of AI,” serving as the primary platform for hosting a vast majority of models and datasets in the AI community. It also furnishes tools that simplify the process of downloading models and datasets. With the Hugging Face Python libraries, achieving this task requires just a few lines of code. For instance, utilizing the huggingface_hub to load models and the datasets library to load datasets.

Read more

Install Python 3.12 on CentOS 7

I’m currently immersed in learning AIGC, and Python is an essential tool for almost every aspect of it. In my attempt to set up Python on CentOS, I encountered installation challenges with both Python 3.12 and Python 3.11, leading to installation failures. Both of them gave me following error:

Python runtime state: initialized
Traceback (most recent call last):
  File "/local/usr/local/src/python/Python-3.11.0/Lib/site.py", line 73, in <module>
    import os
  File "/local/usr/local/src/python/Python-3.11.0/Lib/os.py", line 29, in <module>
    from _collections_abc import _check_methods
SystemError: <built-in function compile> returned NULL without setting an exception
make[1]: *** [Python/frozen_modules/abc.h] Error 1
make[1]: Leaving directory `/local/usr/local/src/python/Python-3.11.0'
make: *** [profile-opt] Error 2
Read more