Upgrade to python > 3.9 on Cloud 9

0

My current Cloud9 environment has Python 3.7.16, I need to upgrade to 3.8 and up. How do I do it? Thank you.

Max
已提問 1 年前檢視次數 5613 次
2 個答案
4

What operating system does Cloud9 use?
Amazon Linux2 vagy Ubuntu?

I think a good way to upgrade is to add pyenv and switch from 3.7 to 3.9.

For example, if you are on Amazon Linux2, execute the following command.

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
cat << 'EOT' >> ~/.bashrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
EOT
source ~/.bashrc
sudo yum -y update
sudo yum -y install bzip2-devel
sudo yum -y install xz-devel
pyenv install 3.9.13
pyenv global 3.9.13

Also, since Cloud9 seems to have a Python alias set by default, please set the following command in "~/.bash_profile".

export PATH="$HOME/.pyenv/shims:$PATH"

You can confirm that the version changes by executing the following command after setting.

source ~/.bash_profile
python --version
profile picture
專家
已回答 1 年前
profile picture
專家
已審閱 8 個月前
  • Thanks, this worked for me. I ran "pip3.9 install boto3" on top before I could start using it..

0

I always upgrade with ...

wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
tar -xf Python-3.9.9.tgz
cd Python-3.9.9
./configure --enable-optimizations
sudo make altinstall
profile picture
ARBR
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南