Skip to content

Build python from source

Build python có sử dụng openssl, vì vậy cần build openssl trước

  • Clone source file
    wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz
    
  • Configure
    ./configure --enable-optimizations --prefix=/usr/local/python3.12 --with-openssl=/root/sources/openssl-3.2.1
    
  • Build executable
    make
    make test
    sudo make install
    
  • Export variable
    export PATH=/usr/local/python3.12/bin:$PATH
    
  • Kiểm tra executable
    python3.12 --version