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
EXPERTE
gefragt vor 10 Monaten601 Aufrufe
2 Antworten
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor 10 Monaten
profile picture
EXPERTE
überprüft vor 10 Monaten
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

beantwortet vor 8 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen