-1

I recently installed python3.9.6 on kali linux and it all seemed to work but when enter python3 on the terminal it shows python3.9.2, not python3.9.6 . Also when I type python its shows python 2.7.2 .

I want to type in python, python3, or python3.9 to open python3.9.6 can someone help me please change this?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Why not just type `python3.9.6`? Perhaps set the symlinks correctly? – Mad Physicist Aug 24 '21 at 13:30
  • E.g., `ls -al /usr/bin/python3.9; ln -s python3.9.6 /usr/bin/python3` – Mad Physicist Aug 24 '21 at 13:32
  • Thanks for your comment but that does not work. Because when I type python3.9.6 there nothing that is there. But when I type python 3.9, python 3.9.6 shows up. When I type python3 python 3.9.2 shows up and when I type python python 2.7.x shows up. I want to be able to enter python and it use the version 3.9.6 . – david wilkins Aug 24 '21 at 20:06
  • You don't want that, because the reason your system python is python 2 is that there are a bunch of scripts that depend on it. It would be much safer to restrict yourself to move `python3` to `python3.9.2` and link `python3` to `python3.9` at that point. – Mad Physicist Aug 24 '21 at 21:01
  • What does `ls -al1 /usr/bin | grep python` show? – Mad Physicist Aug 24 '21 at 21:02
  • I've done it on two different computer and there is nothing wrong with it. But I am having trouble figuring that out now. On kali linux python 2 is outdated and everything scripted is converted to python3. I want to be able to type python and have the version be 3.9.6. python2 can be assigned a different name and same thing as python3.9.2 . – david wilkins Aug 24 '21 at 22:37
  • Uninstall all the versions of python you have, then reinstall the only one you want – Mad Physicist Aug 24 '21 at 22:45

1 Answers1

0

Uninstall all the redundant versions of Python 3.x that you have, then reinstall the only one you want (e.g. python3.9.6).

In the latest version of Kali Linux, all python packages use explicit python3 or python2 interpreter and do not use unversioned /usr/bin/python at all. Some third-party code is now predominantly python3 based, yet may use /usr/bin/python.

python-is-python3 (sudo apt install python-is-python3) is a convenience package which ships a symlink to point the /usr/bin/python interpreter at the current default python3, but it does not add a symlink to point the /usr/bin/python2 interpreter (which is installed by the python-minimal package) at the current default python3. It may improve compatibility with other modern systems, while breaking some obsolete or third-party software.

python-is-python3 replaces: python, python-is-python2.

karel
  • 5,489
  • 46
  • 45
  • 50