Install Python3 in Kali Linux

After writing about Ct-Exposer and CMSeeK some comments appearing in our comment box. Some people of us have problem to installing Python3 in their Kali Linux System. They need to upgrade Kali Linux 2020 versions because in newer versions of Kali Linux Python3 comes pre-installed, or if need manual installation then follow our guide.
Install Python3 in Kali Linux
Install Python3 in Kali Linux

We don't need to install Python3 in recent updated and full-upgraded Kali Linux. Because Kali Linux 2019.1 is comes with Python 3.6 pre-installed. But if we have older version of Kali Then.
 Installing Python3 is very easy. We need to go to the Download section of official Python website. 

https://www.python.org/downloads/
Download Section of https://www.python.org/



Now we click on Download Python 3.x.x (As of this writing, the latest is Python 3.7.4) and download the tar.xz compressed file. After finishing the download we open the Terminal window is our Kali Linux system.
We will run a command to check the updates

apt-get update

After updating (if available) we need to go to the Downloads section by using following command:

cd Downloads
Then we type following command:

tar -xvf Python-3.x.x.tar.xz
Here 3.x.x. is representing our downloaded recent version of Python
The screenshot is following:

python3.tar.xz decompressing

Now we got a decompressed folder of Pyhton3.x.x (whenever we wright Python3.x.x the x.x will represents the downloaded version of Python3 for us that is Python 3.7.4).
Now we go to the folder Python3.x.x by applying following command :

cd Python3.x.x
Then we need to configure the Python3 before install. So we configure it by using following command:

./configure
The screenshot is following:

./configure python3

Then we need to run make to compile the Python source before install.

make
It will take a little time. The screenshot is following:

python3 make

Then we can install Python3.x.x by using following command:

make install

python3 kali linux make install

This will take time. So sit back and share our this post to friends.

When this process will complete we will check the version of python3 by using following command:

python3 -V
The following screenshot shows that we have Python version 3.7.4.

pyhton 3.7.4 in Kali Linux

When we need to use Python 2 we just type python in Kali Linux terminal and when we need Python 3 we type python3 in our Kali Linux system.

Python 3.6 is pre-installed in newer Kali Linux system. But by default pip3 is not there to install pip3 run following command :

apt-get install python3-pip

30 comments:

  1. there is showing "please use python 3 to install wifiphisher". i installed python 3 latest version. but again is showing.

    ReplyDelete
    Replies
    1. Thanks for your valuable comment . Can you tell us what command you have used? Try following commands:
      git clone https://github.com/wifiphisher/wifiphisher.git
      cd wifiphisher
      sudo python3 setup.py install

      Delete
    2. Writes modulenotfounderror: no module named 'setuptools'

      What to do?

      Delete
    3. Install setuptools and try again.

      try command:

      sudo apt-get install -y python-setuptools

      Delete
  2. Traceback (most recent call last):
    File "setup.py", line 23, in
    from setuptools import Command, find_packages, setup
    ModuleNotFoundError: No module named 'setuptools'

    ReplyDelete
  3. I already try this command "git clone https://github.com/wifiphisher/wifiphisher.git
    cd wifiphisher
    sudo python3 setup.py install"

    But still i encouter error "December 29, 2019 at 10:14 PM

    Traceback (most recent call last):
    File "setup.py", line 23, in
    from setuptools import Command, find_packages, setup
    ModuleNotFoundError: No module named 'setuptools'"

    ReplyDelete
    Replies
    1. Thanks for your valuable comment. Check this link out

      https://stackoverflow.com/questions/14426491/python-3-importerror-no-module-named-setuptools

      Delete
  4. Muchas gracias por haberse tomado su tiempo para compartir sus conocimientos!

    ReplyDelete
  5. E: Package 'python-setuptools' has no installation candidate
    This is the error i am getting

    ReplyDelete
    Replies
    1. Hi Maxwel, use following commands to solve this error
      sudo apt-get update

      sudo apt-get upgrade

      sudo apt-get install python-setuptools

      Let us know if this works.

      Delete
    2. xxx@kali:~/app $ sudo apt-get install python-setuptools
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Package python-setuptools is not available, but is referred to by another package.
      This may mean that the package is missing, has been obsoleted, or
      is only available from another source

      E: Package 'python-setuptools' has no installation candidate

      Delete
    3. Try following commands one by one:
      sudo apt-get update

      sudo apt-get upgrade

      sudo apt-get install python-setuptools

      Delete
  6. E: Package 'python3-pip' has no installation candidate
    what i do after am install python3

    ReplyDelete
    Replies
    1. Try following commands one after another:

      curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
      python get-pip.py
      python3 get-pip.py

      It should install pip3 you can check the version by using:
      pip3 -V

      Delete
  7. it tried it but i am not able to install help me . https:dirtypic.xyz

    ReplyDelete
  8. i wrote ,,apt-get install python3-pip" and i got information : ,, SyntaxError: invalid syntax" what can i do?

    ReplyDelete
  9. rahul@kali:~/Downloads/Python-3.8.5$ make install
    if test "no-framework" = "no-framework" ; then \
    /usr/bin/install -c python /usr/local/bin/python3.8; \
    else \
    /usr/bin/install -c -s Mac/pythonw /usr/local/bin/python3.8; \
    fi
    /usr/bin/install: cannot create regular file '/usr/local/bin/python3.8': Permission denied
    make: *** [Makefile:1235: altbininstall] Error 1






    After make install i am facing this problem

    ReplyDelete
    Replies
    1. You should try following command:
      sudo make install

      Delete
  10. zipimport.ZipImportError: can't decompress data; zlib not available
    make: *** [Makefile1186: install] Error 1

    After make install. is there a solution?

    ReplyDelete
    Replies
    1. (I am using python 3.8.5)

      Delete
    2. You are already in Python3. The problem is zlib is missing from your system. You can install it by applying following command:
      sudo apt-get install zlib1g-dev

      Delete
  11. please when i install python3-pip then show this error
    ackage python3-pip is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'python3-pip' has no installation candidate

    ReplyDelete
  12. Try following commands one by one
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt install python3-pip

    ReplyDelete
  13. i install python3 but in version it shown python 2.7

    ReplyDelete
    Replies
    1. Try the following command:

      python3 --version

      And show us the output in comment section.

      Delete
    2. it show 3.8.5

      Delete
    3. It shows that you sucessfully installed Python3. Are you trying python command before script. To use Python3 you always need to use Python3 command, Like

      Python3 myscript.py

      Hope this will help you.

      Delete

Please do not spam here. It is comment box not a spambox. Promotional links are not allowed.

Powered by Blogger.