[Python] Python 3.11 missing _sqlite3, _bz2, _ssl and multiple random packages - how to...

Discussão em 'Python' iniciado por Stack, Fevereiro 12, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to compile the python from source as our sysadmin would want to keep it clean. The problem is that when I compile Python3.11.11 from source code, the binary is missing so many packages that anything we are trying to run just breaks because of random packages missing. What I need is a completed instruction to compile the Python3.11.11 without missing these random packages which are so essential for apps to run properly. Or if there is any Python3.11.11 tarbal which do not have these random packages missing? The one I downloaded from is: https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tgz

    I've managed to get following packages installed from SA but the python still misses random packages.

    sudo yum install -y gcc-c++
    sudo yum install -y bzip2-devel
    sudo yum install -y libsqlite3x-devel
    sudo yum install -y gcc gcc-c++ make zlib-devel bzip2 bzip2-devel readline-devel \
    sqlite sqlite-devel openssl-devel libffi-devel xz-devel


    Initially it was missing the SSL module so even pip install was not working. So I used the below commands to make it work. Now the problem is that when I try to run superset it has _bz2 missing. When I run jupyter notebook it is missing _sqlite3. The problem is that even if I get these packages working - there is no guarantee that there will not be some other random package missing again. Is there any Python package which doesn't have these random packages missing?

    Here's the instructions which worked so far to install ssl. Now I need instruction to include sqlite and bz2 in these compilation steps (there might be others after I recompile fixing these)

    Here's the set of instructions I have so far:

    cd /usr/local/src
    wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
    tar -xvzf openssl-1.1.1w.tar.gz
    cd openssl-1.1.1w

    # Configure and install OpenSSL in /opt/openssl
    ./config --prefix=/opt/openssl --openssldir='/opt/openssl'
    make
    make install


    /opt/openssl/bin/openssl version

    cd /usr/local/src
    wget https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tgz
    tar -xvzf Python-3.11.11.tgz
    cd Python-3.11.11

    export LD_RUN_PATH='/opt/openssl/lib'
    ./configure --prefix=/opt/apps/python3 \
    --with-openssl=/opt/openssl

    make

    make altinstall

    /opt/apps/python3/bin/python3.11 --version

    /opt/apps/python3/bin/python3.11 -m pip install --upgrade pip

    echo 'export PATH=/opt/apps/python3/bin:$PATH' >> ~/.bashrc
    source ~/.bashrc

    Continue reading...

Compartilhe esta Página