我想改变我的Google上的python版本。目前,它正在运行python 3.7:
[In]: ! python --version
[Out]: Python 3.7.13
我想要python3.10,所以我遵循了this post中的说明
! sudo apt-get update -y
! sudo apt-get install python3.10
! sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
! sudo update-alternatives --config python3
这里,打印了一个列表,我选择python 3.10。然后
! sudo apt install python3-pip
现在,当我查询python版本时,它显示了3.10:
[In]: ! python --version
[Out]: Python 3.10.6
到目前为止还不错!但是,现在有两个问题:
!pip install gym
和!pip3 install gym
都给出了以下错误:AttributeError: module 'collections' has no attribute 'MutableMapping'
[In]: (a := 3)
[Out]: SyntaxError: invalid syntax
[In]: a: list[int] = [1]
[Out]: TypeError: 'type' object is not subscriptable
发布于 2022-08-12 04:24:45
你必须降低蟒蛇的等级。
自3.3版起就不再受欢迎,将在3.10版中删除:将集合抽象基类移动到collections.abc模块中。为了向后兼容,通过Python3.9,它们在这个模块中仍然是可见的。
https://stackoverflow.com/questions/73328635
复制相似问题