This blog is NOT OFFICIAL website of Kali Linux. We just share Tutorials to learn Cybersecurity.

Install Python3 in Kali Linux

Home
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

author-img
Kali Linux

Comments

34 comments
Post a Comment
  • Unknown photo
    UnknownDecember 19, 2019 at 8:10 PM

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

    Delete Comment
    • Kali Linux photo
      Kali LinuxDecember 19, 2019 at 9:42 PM

      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 Comment
      • Unknown photo
        UnknownDecember 26, 2019 at 2:18 PM

        Writes modulenotfounderror: no module named 'setuptools'

        What to do?

        Delete Comment
        • Kali Linux photo
          Kali LinuxDecember 26, 2019 at 7:26 PM

          Install setuptools and try again.

          try command:

          sudo apt-get install -y python-setuptools

          Delete Comment
          • Unknown photo
            UnknownFebruary 4, 2021 at 3:10 PM

            sir can we use pycharm for python scripts for kali linux i need an answer sir thanks

            Delete Comment
            • Kali Linux photo
              Kali LinuxFebruary 4, 2021 at 5:29 PM

              Yes. We can use Pycharm IDE on Kali Linux. We will create a tutorial on it very soon. Thanks.

              Delete Comment
            • Unknown0001 photo
              Unknown0001December 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'

              Delete Comment
              • Unknown0001 photo
                Unknown0001December 29, 2019 at 10:17 PM

                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'"

                Delete Comment
                • Kali Linux photo
                  Kali LinuxDecember 30, 2019 at 7:26 AM

                  Thanks for your valuable comment. Check this link out

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

                  Delete Comment
                • Unknown photo
                  UnknownFebruary 4, 2020 at 12:46 PM

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

                  Delete Comment
                • Maxwel photo
                  MaxwelApril 3, 2020 at 5:57 PM

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

                  Delete Comment
                  • Kali Linux photo
                    Kali LinuxApril 3, 2020 at 7:27 PM

                    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 Comment
                    • Ryo photo
                      RyoMay 30, 2020 at 11:12 PM

                      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 Comment
                      • Kali Linux photo
                        Kali LinuxMay 31, 2020 at 8:17 AM

                        Try following commands one by one:
                        sudo apt-get update

                        sudo apt-get upgrade

                        sudo apt-get install python-setuptools

                        Delete Comment
                      • Yes d Tech (shailesh) photo
                        Yes d Tech (shailesh)June 19, 2020 at 8:40 PM

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

                        Delete Comment
                        • Kali Linux photo
                          Kali LinuxJune 20, 2020 at 8:10 AM

                          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 Comment
                        • AnonymousJune 25, 2020 at 7:10 AM

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

                          Delete Comment
                        • Unknown photo
                          UnknownJuly 25, 2020 at 12:37 AM

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

                          Delete Comment
                          • rahulJuly 27, 2020 at 4:15 PM

                            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

                            Delete Comment
                          • Unknown photo
                            UnknownAugust 13, 2020 at 1:54 AM

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

                            After make install. is there a solution?

                            Delete Comment
                            • AnonymousAugust 13, 2020 at 2:17 AM

                              (I am using python 3.8.5)

                              Delete Comment
                              • Kali Linux photo
                                Kali LinuxAugust 13, 2020 at 5:10 AM

                                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 Comment
                              • Unknown photo
                                UnknownAugust 23, 2020 at 2:05 PM

                                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

                                Delete Comment
                                • Kali Linux photo
                                  Kali LinuxAugust 23, 2020 at 7:44 PM

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

                                  Delete Comment
                                  • AnonymousOctober 5, 2020 at 3:21 AM

                                    i install python3 but in version it shown python 2.7

                                    Delete Comment
                                    • Kali Linux photo
                                      Kali LinuxOctober 5, 2020 at 7:43 AM

                                      Try the following command:

                                      python3 --version

                                      And show us the output in comment section.

                                      Delete Comment
                                      • AnonymousOctober 5, 2020 at 3:39 PM

                                        it show 3.8.5

                                        Delete Comment
                                        • Kali Linux photo
                                          Kali LinuxOctober 5, 2020 at 5:36 PM

                                          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 Comment
                                        • AnonymousDecember 7, 2020 at 7:56 PM

                                          Pls pls also give a tutorial to install pip and requests

                                          Delete Comment
                                          • Kali Linux photo
                                            Kali LinuxDecember 8, 2020 at 11:11 AM

                                            This is very easy to install pip use following command:

                                            sudo apt install python3-pip

                                            To install requests module use following command:

                                            sudo pip3 install requests

                                            Delete Comment
                                          • AnonymousOctober 5, 2023 at 2:15 AM

                                            Python3 can't open the storm-Breaker and seeker files

                                            Delete Comment
                                            google-playkhamsatmostaqltradent