I want to use Python 3.9 with CloudShell.

0

I would like to use Python 3.9 with CloudShell.
Python 3.9 is required in pyenv because Python 3.9 is used in the Lambda runtime.
I tried to use Python 3.9.17 with pyenv by running the following command, but the command gets stuck at the "pyenv global 3.9.17" stage.
Is it possible to use Python 3.9 without pyenv in CloudShell?

sudo yum install gcc
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
source .bash_profile
pyenv install 3.9.17
pyenv global 3.9.17
profile picture
ESPECIALISTA
feita há 10 meses601 visualizações
2 Respostas
1
Resposta aceita

The sam build now succeeds by installing Python 3.9 from source using the following method.

!#bin/bash

sudo yum install gcc openssl-devel bzip2-devel libffi-devel -y
wget https://www.python.org/ftp/python/3.9.17/Python-3.9.17.tgz
tar xzf Python-3.9.17.tgz
cd Python-3.9.17
./configure --enable-optimizations --prefix=$HOME/.local
sudo make altinstall
profile picture
ESPECIALISTA
respondido há 10 meses
profile picture
ESPECIALISTA
avaliado há 10 meses
0

!#bin/bash

sudo yum install gcc openssl-devel bzip2-devel libffi-devel -y wget https://www.python.org/ftp/python/3.9.17/Python-3.9.17.tgz tar xzf Python-3.9.17.tgz cd Python-3.9.17 ./configure --enable-optimizations --prefix=$HOME/.local sudo make altinstall

respondido há 8 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas