[clug] Building Python3.7 RPM on CentOS 7

jm jeffm at ghostgun.com
Thu May 30 06:22:03 UTC 2019

Anyone have any directions for creating a rpm of python 3.7 on CentOS
7?  I'm trying the steps detailed below and running to problems,

$ curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz

$ xz -d Python-3.7.3.tar.xz
$ tar xvf Python-3.7.3.tar
$ cd Python-3.7.3

$ ./configure --enable-optimizations --with-lto 
--prefix=/usr/local/python37/ CXX="/usr/bin/g++"

Output includes these line,

checking for pkg-config... /usr/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking for X509_VERIFY_PARAM_set1_host in libssl... yes
checking for --with-ssl-default-suites... python

$ make
$ ./python setup.py bdist_rpm

Local Install
as root:
# make altinstall

Create Python Virtual Environment

$ /usr/local/python37/bin/python3.7 -m venv $HOME/py37
$ source $HOME/py37/bin/activate

$ which python

$ python -V
Python 3.7.3

Build RPM
$python setup.py bdist_rpm

This produces several error ending with

Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with
LibreSSL 2.6.4 and earlier do not provide the necessary APIs,

running build_scripts
creating build/scripts-3.7
error: file
does not exist
error: Bad exit status from /var/tmp/rpm-tmp.uJBjOh (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.uJBjOh (%build)
error: command 'rpmbuild' failed with exit status 1



More information about the linux mailing list