Clo*_*ude 2 python linux google-cloud-platform google-cloud-shell
我想在我的 google cloud shell 中升级到 python 3.10,但我失败了。我在网上找到了两种方法,目前为止都不成功。
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
Run Code Online (Sandbox Code Playgroud)
但我收到一个错误The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu kinetic Release' does not have a Release file.
-bash: python3.10: command not found。这对我来说很有效。即使 shell 重新启动后,默认的 python 版本仍然是 3.10.7。
# install pyenv to install python on persistent home directory
curl https://pyenv.run | bash
# add to path
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
# updating bashrc
source ~/.bashrc
# install python 3.10.7 and make default
pyenv install 3.10.7
pyenv global 3.10.7
# execute
python
Run Code Online (Sandbox Code Playgroud)
感谢@ali-khorso 和@yungchin。链接到帖子
| 归档时间: |
|
| 查看次数: |
3709 次 |
| 最近记录: |