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
EXPERT
asked 10 months ago577 views
2 Answers
1
Accepted Answer

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
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago
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

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions