Categories
Debugging Python

UnicodeDecodeError: E: sub process returned an error code

How to fix ‘UnicodeDecodeError’ in Linux

Hi Geeks,

In this post, am going to show you how to solve the following error in Kali Linux. The steps followed in this post is same to all Debian Linux distributions. Read the whole blog for better understanding.

E: problem executing scripts APT::update:post-invoke-success
file /usr/share/commnd-not-found/CommandNorFound/db/creator.py
UnicodeDecodeError: 'utf-8' code can't decode byte 0xed in position 15: Invalid continuation byte
E: sub process returned an error code

Why this error Occurred ?

 When I ran any commends in Linux terminal the following error message was showed. It is a python DPKG error. In your system any python packages are missing, then you was encountered by this error. During executing python, you was encountered by this error. Then no problem.

But it shows the message all the time. Even update commend also encountered by this error. But it doesn’t stop the process of the commend. Only shows the useless error message. But it makes you feel annoying. So you want to debug this error.

E: problem executing scripts APT::update:post-invoke-success 
file /usr/share/commnd-not-found/CommandNorFound/db/creator.py 
UnicodeDecodeError: 'utf-8' code can't decode byte 0xed in position 15: Invalid continuation byte 
E: sub process returned an error code

Solution for UnicodeDecodeError:

In your system you want to install the missed python packages. No need for installing the missed packages manually. Simply update and upgrade your system. Finally reboot it. During this process all the missed python packages are automatically installed.

Open a terminal and run the following commends,

mk007@linuxlia:~$ sudo apt-get update
mk007@linuxlia:~$ sudo apt-get dist-upgrade
mk007@linuxlia:`$ sudo reboot

Some other Python Bugs:

pip: command not found error in Kali Linux

https://linuxlia.com/2021/01/30/import-error-no-module-named/

‘Python 2.7 End of life’- What happened to Python 2.7?

Python & Debugging Tutorial

Pychram Tutorial

If you want to learn about PyCharm and software development. Then this is for you geeks.

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.

Categories
PyCharm Tutorial Python

PyCharm Installation- Step by Step Guide

How to Install PyCharm in Kali Linux

Hi Geeks,

In this post, am going to show you how to install PyCharm in Kali Linux. The steps followed in this post is same to all other debian Linux distributions.

PyCharm:

PyCharm is an integrated development environment used in computer programming, specifically for the Python language. It is developed by the Czech company JetBrains.

Steps:

  • Download and Extract zip file
  • Install PyCharm
  • Add icon to Desktop

 

Download and Extract PyCharm zip file:

Installing PyCharm is pretty simple.

Here, the community version is free, but for the professional version, you need to buy the license. I will be working on the community version.

After downloading the zip package, first of all extract it.

 Installation:

  • Open the terminal and switch the directory to where the extracted file was located. Also switch the directory to bin directory.
mk007@linuxlia:~ cd /Downloads/PyCharm/Bin
  • Now run the following commend for executing the packages.
mk007@linuxlia:~ /Downloads/Pycharnm/Bin$ sudo ./pycharm.sh

  • Now setup menu was opened. Here read the privacy policy of JetBrains and if you got satisfied with it. Then click Continue and hit enter for installing.

  • Choose the theme and click ‘OK’. I prefer for dark one.

  •  Now choose the path where you want to save the script. I prefer for default path. So, I click enter.

  •  If you need any plugin, then click or choose the plugins and install it.

  •  Finally it was installed successfully.

Add icon to Desktop:

  • Open the installed App and click Configure.
  • Here click ‘Create Desktop Entry’ option.

  • Click ‘OK’ for adding icon to the desktop.

Check out the PyCharm Tutorial for becoming a successful developer.

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.

Categories
Python

pip: command not found error in Kali Linux

How to install PIP in Kali Linux

Hi Geeks,

In this post, am going to show you how to solve the pip: command not found error. The steps followed in this post is same to all other debian Linux distributions.

PIP:

pip is a package-management system written in Python used to install and manage software packages. It connects to an online repository of public and paid-for private packages, called the Python Package Index.

Why this error occurred ?

One of the most common problems with running Python tools like pip is the “Command Not Found” error. This means that python cannot find the PIP installation. So first of all you want to install PIP.

bash: pip: command not found

In most cases, you’ll need to navigate to the directory in which the tool is installed before you can run the command to launch it. Otherwise you want to install pip manually.

Content:

  • Python-PIP Installation
  • Python2-PIP Installation
  • Python3-PIP Installation

Python-PIP Installation:

If you use python ordinary version, then you want to download pip in normal version.

Open a terminal and run the following command,

mk007@linuxlia:~$ sudo apt-get install python-pip

Check the version of pip by running thr following command,

mk007@linuxlia:~$ pip --version

Python2-PIP Installation:

If you have python2 then you want to download pip2.

Open a terminal and run the following command,

mk007@linuxlia:~$ sudo apt-get install python2-pip

Check the version of pip by running thr following command,

mk007@linuxlia:~$ pip2 --version

Python3-PIP Installation:

If you have python3 then you want to download pip3.

Open a terminal and run the following command,

mk007@linuxlia:~$ sudo apt-get install python3-pip

Check the version of pip by running thr following command,

mk007@linuxlia:~$ pip3 --version

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.

 

Some other Python Bugs:

UnicodeDecodeError: E: sub process returned an error code

https://linuxlia.com/2021/01/30/solution-for-import-error/

‘Python 2.7 End of life’- What happened to Python 2.7?

Categories
Python

ImportError: No module named ‘google’ in Kali Linux

How to fix ‘Import Error: No module named ‘Package Name’ in Kali Linux.

Hi Geeks,

In this post, am going to show you how to solve the ImportError. The steps followed in this post is same to all other debian Linux distributions.

Why ImportError was occurred ?

The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to an invalid or incorrect path, which will raise a ModuleNotFoundError or ImportError in Python 3.6 and newer versions.

Traceback (most recent call last):
  File "mountain.py", line 28, in ?
    from toolkit.interface import interface
ImportError: No module named toolkit.interface

Solution for ImportError:

In your system you want to install the missed python packages manually. There are two methods are available for downloading the missed packages.

Method 1:

PIP:

pip is a package-management system written in Python used to install and manage software packages. It connects to an online repository of public and paid-for private packages, called the Python Package Index.

For me google packages are missing. So the following error message was printed.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'google'

Open a terminal and run the following pip command, (In this command replace google to ‘missed package’)

mk007@linuxlia:~$ sudo pip install google

But sometimes this command also encountered by the same error. Then follow the second method.

Method 2:

In this method, am going to download the google module in there official site and setup it to the python packages.

For me google packages are missing.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'google'

  • After downloading the zip package, first of all extract it.
  • Open the terminal and switch the directory to where the extracted module was located.
  • Now run the following command for adding the package to python.
mk007@Linuxlia:~/Downloads/Google $ python setup.py install

Finally inner peace.

For some unlucky persons, both methods may not work. Then see this post,

https://linuxlia.com/2021/01/30/solution-for-import-error/

 

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.

 

Some other Python Bugs:

pip: command not found error in Kali Linux

Python 3- Installation Guide for Kali Linux

How to Install Python 2.7 in Kali Linux 2021

Categories
Python

ImportError: No module named ‘Package Name’

Import Error: No Module Named ‘Packages’

Hi Geeks,

In this post, am going to show you how to solve the ImportError. The steps followed in this post is same to all other Linux distributions.

Why ImportError was occurred ?

The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to an invalid or incorrect path, which will raise a ModuleNotFoundError or ImportError in Python 3.6 and newer versions.

Traceback (most recent call last):
  File "mountain.py", line 28, in ?
    from toolkit.interface import interface
ImportError: No module named toolkit.interface

Solution for ImportError:

In your system you want to install the missed python packages manually. There are three methods are available for downloading the missed packages.

Method 1:

In your system you want to install the missed python packages. No need for installing the missed packages manually. Simply update and upgrade your system. Finally reboot it.

Open a terminal and run the following commends,

mk007@linuxlia:~$ sudo apt-get update
mk007@linuxlia:~$ sudo apt-get dist-upgrade
mk007@linuxlia:`$ sudo reboot

 

Method 2:

PIP:

pip is a package-management system written in Python used to install and manage software packages. It connects to an online repository of public and paid-for private packages, called the Python Package Index.

For me google packages are missing. So the following error message was printed.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'google'

Open a terminal and run the following pip command, (In this command replace google to ‘missed package’)

mk007@linuxlia:~$ sudo pip install google

But sometimes this command also encountered by the same error. Then follow the second method.

 

Method 3:

In this method, am going to download the google module in there official site and setup it to the python packages.

For me google packages are missing.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'google'

  • After downloading the zip package, first of all extract it.
  • Open the terminal and switch the directory to where the extracted module was located.
  • Now run the following command for adding the package to python.
mk007@Linuxlia:~/Downloads/Google $ python setup.py install

Conclusion:

If you have any doubts about this post please leave a comment. Am ready to solve your doubts.

Categories
Python

‘Python 2.7 End of life’- What happened to Python 2.7?

How to Remove Python 2.7 Packages in Kali Linux

Hi Geeks,

In this post, am going to show you how to remove python 2.7 packages in Linux. Because python was discontinued this version.

Python 2.7:

Python 2.7.2 was released on June 11th, 2011.

The Python 2.7 series is scheduled to be the last major version in the 2.x series before 2.x moves into an extended maintenance period. The 2.7 series contains many of the features that were first released in Python 3.1.

End of Python 2.7 :

Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.

Python 3.9:

Python 3.9.0 is the newest major release of the Python programming language, and it contains many new features and optimizations.

Python 2.7 Bugs:

Python 2.7 causes lot of bugs due to end of life. Most of the users are encountered by the following two errors.

ImportError:

The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to an invalid or incorrect path.

Traceback (most recent call last):
  File "mountain.py", line 28, in ?
    from toolkit.interface import interface
ImportError: No module named toolkit.interface

 

UnicodeDecodeError:

When I ran any commends in Linux terminal the following error message was showed. It is a python DPKG error. In your system any python packages are missing, then you was encountered by this error. During executing python, you was encountered by this error.

E: problem executing scripts APT::update:post-invoke-success
 file /usr/share/commnd-not-found/CommandNorFound/db/creator.py
 UnicodeDecodeError: 'utf-8' code can't decode byte 0xed in position 15: Invalid continuation byte 
E: sub process returned an error code

Solution for UnicodeDecodeError:

In your system you want to install the missed python packages. No need for installing the missed packages manually. Simply update and upgrade your system. Finally reboot it. During this process all the missed python packages are automatically installed.

 

How to remove Python 2.7 Packages?

Open a terminal and run the following command for removing outdated python 2.7 packages.

mk007@linuxlia:`$ sudo apt-get autoremove python-pip

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.

Categories
Python

Python 3- Installation Guide for Kali Linux

How to Install Python Latest Version in in Kali Linux

Hi Geeks,

In this post, am going to show you how to install Python latest version in Kali Linux without any errors (Import error, bash: pip: command not found).

Python 3.9:

Python 3.9.0 is the newest major release of the Python programming language, and it contains many new features and optimizations.

Why Python 3?

Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.

Python 2.7 Bugs:

Python 2.7 causes lot of bugs due to end of life. Most of the users are encountered by the following two errors.

ImportError:

The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to an invalid or incorrect path.

Traceback (most recent call last):
  File "mountain.py", line 28, in ?
    from toolkit.interface import interface
ImportError: No module named toolkit.interface

UnicodeDecodeError:

When I ran any commends in Linux terminal the UnicodeDecodeError message was showed. It is a python DPKG error. In your system any python packages are missing, then you was encountered by this error. During executing python, you was encountered by this error.

E: problem executing scripts APT::update:post-invoke-success
 file /usr/share/commnd-not-found/CommandNorFound/db/creator.py
 UnicodeDecodeError: 'utf-8' code can't decode byte 0xed in position 15: Invalid continuation byte 
E: sub process returned an error code

 

Python3 Installation:

Steps:

  • Dowload Python3 and PIP
  • Install the required Libraries
  • Install CSDK and Python SDK installation

Step 1 : Download Python3 and PIP

Open a terminal and run the following commands for installing the latest version of python and pip.

mk007@linuxlia:~$ sudo apt-get install python3-pip

Step 2 : Install the required Libraries

Open a terminal and run the following commands for installing required libraries. This step will prevent you from ImportError.

mk007@linuxlia:~$ sudo pip3 install sgmllib3k
mk007@linuxlia:~$ sudo pip3 install paramiko
mk007@linuxlia:~$ sudo pip3 install httplib2
mk007@linuxlia:~$ sudo pip3 install pyyaml
mk007@linuxlia:~$ sudo pip3 install pytz 
mk007@linuxlia:~$ sudo pip3 install Geohash
mk007@linuxlia:~$ sudo pip3 install python-geohash
mk007@linuxlia:~$ sudo pip3 install deepdiff
mk007@linuxlia:~$ sudo pip3 install pyes

Step 3 : Install CSDK and Python SDK

Open a terminal and run the following commands for installing CSDK and Python SDK.

mk007@linuxlia:~$ wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add - 
mk007@linuxlia:~$ wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb
mk007@linuxlia:~$ sudo dpkg -i couchbase-release-1.0-6-amd64.deb
mk007@linuxlia:~$ apt-get update 
mk007@linuxlia:~$ pip3 install couchbase

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.

Categories
Python

Upgrade Python 2.7 to Python 3.9.0 in Kali Linux

How to Upgrade Python 2.7 to Python 3 in Kali Linux

Hi Geeks,

In this post, am going to show you how to upgrade Python 2.7 to python 3 in Kali Linux without any errors (Import error, bash: pip: command not found).

Python 3.9:

Python 3.9.0 is the newest major release of the Python programming language, and it contains many new features and optimizations.

Why Python 3?

Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.

 

Python 2.7 Bugs:

Python 2.7 causes lot of bugs due to end of life. Most of the users are encountered by the following two errors.

ImportError:

The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to an invalid or incorrect path.

Traceback (most recent call last):
  File "mountain.py", line 28, in ?
    from toolkit.interface import interface
ImportError: No module named toolkit.interface

UnicodeDecodeError:

When I ran any commends in Linux terminal the UnicodeDecodeError message was showed. It is a python DPKG error. In your system any python packages are missing, then you was encountered by this error. During executing python, you was encountered by this error.

E: problem executing scripts APT::update:post-invoke-success
 file /usr/share/commnd-not-found/CommandNorFound/db/creator.py
 UnicodeDecodeError: 'utf-8' code can't decode byte 0xed in position 15: Invalid continuation byte 
E: sub process returned an error code

 

Upgrade Python 2.7 to 3.9.0 :

Steps:

  • Remove Python 2.7
  • Install Python 3.9.0
  • Install PIP3
  • Check the version of Python

Step 1 : Remove Python 2.7

Open a terminal and type the following command for removing python 2.7 packages.

mk007@linuxlia:~$ sudo apt purge -y python2.7-minimal

Step 2 : Install Python 3

Open a terminal and run the following commands for installing python 3.9.0

mk007@linuxlia:~$ sudo ln -s /usr/bin/python3 /usr/bin/python

Step 3 : Install PIP

Now run the following commands for installing PIP.

mk007@linuxlia:~$ sudo apt install -y python3-pip
mk007@linuxlia:~$ sudo ln -s /usr/bin/pip3 /usr/bin/pip

Step 4 : Check the Version

Check the version python using the below command.

mk007@linuxlia:~$ python --version

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.

Categories
Python

How to Install Python 2.7 in Kali Linux 2021

Python 2.7 – Installation Guide for Kali Linux 

Hi Geeks,

In this post, am going to show you how to install Python 2.7 in Kali Linux without any errors (Import error, bash: pip: command not found).

Python 2.7:

Python 2.7.2 was released on June 11th, 2011.

The Python 2.7 series is scheduled to be the last major version in the 2.x series before 2.x moves into an extended maintenance period. The 2.7 series contains many of the features that were first released in Python 3.1.

End of Python 2.7 :

Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.

Bugs:

Python 2.7 causes lot of bugs due to end of life.

ImportError: No module named ‘Package Name’

pip: command not found error in Kali Linux

 

Install Python2 :

Steps:

  • Prerequisites for Python
  • Download Python 2
  • Compile python source code.
  • Check python version.

Step 1 : Prerequisites for Python 2

You must want to install the following prerequisites on your system. Open a terminal and execute the following commands on your system for installing all the required dependencies.

mk007@linuxlia:~$ sudo apt-get update
mk007@linuxlia:~$ sudo apt-get install build-essential checkinstall
mk007@linuxlia:~$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev li

Step 2 : Download Python 2.7

Open a terminal and switch the directory to /usr/bin.

mk007@linuxlia:~$ cd /usr/src

Here run the following command for downloading python2 tgz packages.

mk007@linuxlia:~$ wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz

Now extract the tgz packages by running the below command.

mk007@linuxlia:~$ sudo tar xzf Python-2.7.18.tgz

Step 3 : Compile Python Source

Use the following commands to compile Python source code on your system using altinstall.

mk007@linuxlia:~@ cd Python-2.7.18
mk007@linuxlia:~@ sudo ./configure --enable-optimizations
mk007@linuxlia:~@ sudo make altinstall
make altinstall command is used to prevent replacing the default python binary file /usr/bin/python.

Step 4 : Check Python Version

Check the version of python using the following command.

mk007@linuxlia:~@  python2.7 -V
Python 2.7.18

 

How to remove Python 2 Packages?

Open a terminal and run the following command for removing outdated python2 packages.

mk007@linuxlia:`$ sudo apt-get autoremove python-pip

Conclusion:

If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.