O procedimento é válido para outras versões do Python 3.

Primeiro, precisamos instalar localmente a libffi, usada para gerar o ctypes.

mkdir tmp
cd tmp
wget ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz 
tar xvf libffi-3.2.1.tar.gz 
cd libffi-3.2.1 
./configure --prefix=$HOME/opt/ 
make 
make installCode language: PHP (php)

Observe que em ./configure usamos o –prefix=#HOME/opt/. Esse será o local de instalação das bibliotecas e do Python.

Precisamos configurar o arquivo .bashrc para que ao configurar o Python, o compilador reconheça o local da libffi.

vim $HOME/.bashrcCode language: PHP (php)

Adicione a seguinte informação ao final do .bashrc

PATH=$PATH:$HOME/opt/bin:$HOME/bin
export HISTTIMEFORMAT="%d/%m/%y %T "
export PATH="$HOME/opt/bin:$PATH"
export LD_LIBRARY_PATH=$HOME/opt/lib
export LD_RUN_PATH=$HOME/opt/lib
export PKG_CONFIG_PATH=$HOME/opt/lib/pkgconfigCode language: PHP (php)

Salve o arquivo e atualize o terminal

source #HOME/.bashrcCode language: PHP (php)

Ainda na pasta tmp, vamos fazer o download da versão desejada do Python.

wget -c https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz
tar zxvf Python-3.8.11.tgz
cd Python-3.8.11
./configure --prefix=$HOME/opt LDFLAGS="-L$HOME/opt/lib" CPPFLAGS="-I $HOME/opt/lib/libffi-3.2.1/include"
make -j 4
make install
Code language: PHP (php)

Verifique a instalação

which python3.8Code language: CSS (css)

Agora, vamos atualizar o pip e instalar o setuptools

pip3.8 install --upgrade pip setuptoolsCode language: CSS (css)

Pronto, agora é só usar.

,


Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Search

About

Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown prmontserrat took a galley of type and scrambled it to make a type specimen book.

Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown prmontserrat took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Gallery