kali linux切换python默认版本

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/robacco/article/details/88370437

在Kali2019中安装了python2 和python3 ,默认使用python3,可以使用如下命令切换默认版本:

root@kali:~# update-alternatives --install /usr/bin/python python /usr/bin/python2 100
update-alternatives: 使用 /usr/bin/python2 来在自动模式中提供 /usr/bin/python (python)
root@kali:~# update-alternatives --install /usr/bin/python python /usr/bin/python3 150
update-alternatives: 使用 /usr/bin/python3 来在自动模式中提供 /usr/bin/python (python)
root@kali:~# python --version
Python 3.6.6

从python2切换到python3

切换python版本后,若要使用pip可能会出现找不到pip模块的问题,这时我们需要重新安装pip3,如下命令

安装完成:

猜你喜欢

转载自blog.csdn.net/robacco/article/details/88370437