保持 python3.6 处于活动状态

保持 python3.6 处于活动状态

我遇到了一个问题,我需要安装 ansible 和 PIP,但当我安装软件包时,Ubuntu 会自动尝试将 python 更新到版本 3.8。我需要保留版本 3.6,并且我需要所有支持软件包都是 python 3.6

举个例子,我想安装 pip,但是 Ubuntu 想给我提供 python 3.8。有没有办法设置我想要的 python 版本?

 python3 --version
Python 3.6.15

sudo apt-get install pip

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python3-pip' instead of 'pip'
The following packages were automatically installed and are no longer required:
  distro-info-data ieee-data libyaml-0-2
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libexpat1-dev libpython3-dev libpython3.8-dev python-pip-whl python3 python3-dev python3-distutils python3-lib2to3 python3-pkg-resources python3-setuptools python3-wheel python3.8 python3.8-dev zlib1g-dev
Suggested packages:
  python3-doc python3-tk python3-venv python-setuptools-doc python3.8-venv python3.8-doc
The following NEW packages will be installed:
  libexpat1-dev libpython3-dev libpython3.8-dev python-pip-whl python3 python3-dev python3-distutils python3-lib2to3 python3-pip python3-pkg-resources python3-setuptools python3-wheel python3.8 python3.8-dev
  zlib1g-dev
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/7912 kB of archives.
After this operation, 30.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

相关内容