Issue
After trying to install python-psycopg2 with
sudo apt install python-psycopg2
apt
breaks and I cannot even purge that package.
I've got an error when I try to purge with
sudo apt purge python-psycopg2
Error:
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: erro ao processar o pacote python-egenix-mxtools (--configure):
sub-processo script post-installation instalado retornou estado de saída de erro 1
Configurando python-psycopg2 (2.6.1-1build2) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: erro ao processar o pacote python-psycopg2 (--configure):
sub-processo script post-installation instalado retornou estado de saída de erro 1
Erros foram encontrados durante o processamento de:
python-egenix-mxtools
python-psycopg2
E: Sub-process /usr/bin/dpkg returned an error code (1)
I already try
sudo apt clean
sudo apt autoclean
sudo apt autoremove
sudo apt install -f
without success.
I'm using python 3.5. Is it possible that the broken issue caused by trying to install python-psycopg2 instead python3-psycopg2?
I'm halted here. Any help would be great!
Solution
Yes, you should install the right version of the library for your Python version. If a python3-psycopg2
package exists you should install that; however note that it is not generally recommended to use your distribution's packages to install Python libraries, since they are usually out of date. Instead you should use pip
(or pip3
) to install libraries directly from the Python packaging index.
Answered By - Daniel Roseman Answer Checked By - Marilyn (WPSolving Volunteer)