Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

I Actually installed python 3.8 in my kali Linux Operating System, however when I type python in the kali Linux terminal it showing this way 

> Python 2.7.18 (default, Apr 20 2020, 20:30:41) 

How might I set Python 3.8 as my default?

1 Answer

0 votes
by (26.4k points)

What I typically do is install non-default versions of the projects under/usr/local. At that point I design the document $HOME/.bash_profile so the $PATH variable has/usr/loacl/bin first, previously/usr/bin and/bin (which may really be a similar actual registry on your framework).

$HOME/.bash_profile:

# If not running interactively, don't do anything

case $- in

    *i*) ;;

      *) return;;

esac

# PATH starts with...

PATH="/usr/local/bin"

# add $HOME/bin if it exists...

if [ -d "${HOME}/bin" ]; then

  PATH="${PATH}:${HOME}/bin"

fi

# These should exist, add them as fall back....

PATH="${PATH}:/bin:/usr/bin:/sbin:/usr/sbin"

# Some custom locations last

if [ -d /usr/local/arm-elf/bin ]; then

  PATH="${PATH}:/usr/local/arm-elf/bin"

fi

if [ -d /opt/local/bin ]; then

  PATH="${PATH}:/opt/local/bin"

fi

This has the impact of making anything situated in /usr/local/bin the default when I am utilizing an interactive shell, and letting the framework defaults stay basically something else.

Interested to learn python in detail? Come and Join the python course.

Related questions

0 votes
1 answer
0 votes
1 answer
asked May 11, 2020 in Cyber Security by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
asked May 11, 2020 in Cyber Security by Sudhir_1997 (55.6k points)

Browse Categories

...