python - 在与谷歌云连接的谷歌colab中更改python版本
问题描述
我在 google colab 中使用 python 3.7,但由于某种原因,当我与谷歌云中的 linux 服务器连接时,python 变为 2.7。我怎样才能改变它?请注意,python 3.7 已经安装在服务器中。
我尝试了这些东西,但没有帮助。
apt update
sudo apt install python3-pip
alias pip='pip3'
我还检查了这些网站https://cloud.google.com/python/docs/setup#linux_2,如何在 google cloud shell 中安装 Python 3.7 但没有解决我的问题。
解决方案
您可以通过运行 python --version 在命令行检查您的 Python 版本。在 Colab 中,我们可以通过单击 Runtime -> Change Runtime Type 并选择 python3 来强制执行 Python 版本。
推荐阅读
- torch - windows系统安装torch 1.0.1.post2
- python - “如何解决这个问题中的‘函数调用问题’”
- javascript - 在ionic2 + bootstrap4中滚动时,粘性页脚与屏幕一起移动
- java - 获取给定键的树形图中的相邻键/值对
- apache-spark - Spark 不允许在同一 Spark SQL 查询中对同一数据源进行单独查询
- java - 慢跑。OpenGL。如何更新 VBO?
- python - 在两个时间戳之间创建 5 分钟的间隔
- jquery - 查询。$.get(url, callback) 不会触发回调
- python - python将输出写入csv文件
- java - 如何在此代码中显示负数阶乘