E: Sub-process /usr/bin/dpkg returned an error code (1)

Please help me to solve this error

anupam@chandan:/$ sudo dpkg --configure -a
[sudo] password for anupam:
dpkg: error processing package python3-pip (–configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Errors were encountered while processing:
python3-pip
anupam@chandan:/$ sudo apt-get install -f python3-pip
Reading package lists… Done
Building dependency tree
Reading state information… Done
python3-pip is already the newest version (20.0.2-5ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
Need to get 0 B/231 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
dpkg: error processing package python3-pip (–configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Errors were encountered while processing:
python3-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)
anupam@chandan:/$ sudo apt remove python3-pip
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
python3-pip
0 upgraded, 0 newly installed, 1 to remove and 8 not upgraded.
1 not fully installed or removed.
After this operation, 1,050 kB disk space will be freed.
Do you want to continue? [Y/n]
dpkg: error processing package python3-pip (–remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
dpkg: too many errors, stopping
Errors were encountered while processing:
python3-pip
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
anupam@chandan:/$

Hello UPASANA_HAZARIKA,
Welcome to the FOSS Commuity forum.
What program were you trying to install?

This page maybe of help.

  1. Welcome to the group.
  2. I suspect python in corrupted and would start with that.
  3. Good luck