9

When installing on Ubuntu 18.04 (bionic beaver), majority of packages I encounter an error involving "pgadmin4-apache2" that causes the installation to fail. What is causing this error and if it requires the re-installation of "pgadmin4-apache2" how do I go about this?

I tried installing the following packages, of which all failed:

pip3 install python-mysql
sudo apt install mysql-client-core-5.7
sudo apt-get install python3.7-dev libmysqlclient-dev

The error I am getting is the following:

Setting up pgadmin4-apache2 (4.5-1.pgdg18.04+1) ...
Traceback (most recent call last):
  File "setup.py", line 17, in <module>
    from pgadmin.model import db, User, Version, ServerGroup, Server, \
  File "/usr/share/pgadmin4/web/pgadmin/__init__.py", line 38, in <module>
    from pgadmin.setup import get_version, set_version
  File "/usr/share/pgadmin4/web/pgadmin/setup/__init__.py", line 12, in <module>
    from .db_upgrade import db_upgrade
  File "/usr/share/pgadmin4/web/pgadmin/setup/db_upgrade.py", line 11, in <module>
    import flask_migrate
  File "/usr/lib/python3/dist-packages/flask_migrate/__init__.py", line 8, in <module>
    from alembic import __version__ as __alembic_version__
  File "/usr/lib/python3/dist-packages/alembic/__init__.py", line 9, in <module>
    from . import context  # noqa
  File "/usr/lib/python3/dist-packages/alembic/context.py", line 1, in <module>
    from .runtime.environment import EnvironmentContext
  File "/usr/lib/python3/dist-packages/alembic/runtime/environment.py", line 2, in <module>
    from .migration import MigrationContext
  File "/usr/lib/python3/dist-packages/alembic/runtime/migration.py", line 12, in <module>
    from .. import ddl, util
  File "/usr/lib/python3/dist-packages/alembic/ddl/__init__.py", line 1, in <module>
    from . import postgresql, mysql, sqlite, mssql, oracle  # pragma: no cover
ImportError: cannot import name 'mysql'
dpkg: error processing package pgadmin4-apache2 (--configure):
 installed pgadmin4-apache2 package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libpython3.7:amd64 (3.7.1-1~18.04) ...
Setting up libpython3.7-dev:amd64 (3.7.1-1~18.04) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-0ubuntu2) ...
Setting up libmysqlclient-dev (5.7.25-0ubuntu0.18.04.2) ...
Setting up python3.7-dev (3.7.1-1~18.04) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Errors were encountered while processing:
 pgadmin4-apache2

I'm not entirely sure why the installation of "pgadmin4-apache2" happenings every time as well.

In an attempt to solve this issue I did the following:

sudo apt-get purge pgadmin4-apache2

This failed to complete, but despite it's failure I attempted to reinstall "pgadmin4-apache2", but again encountered the error.

sudo apt-get install pgadmin4-apache2

...

ImportError: cannot import name 'mysql'
dpkg: error processing package pgadmin4-apache2 (--configure):
 installed pgadmin4-apache2 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 pgadmin4-apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)


This error is hindering me from installing any additional packages.

Brent
  • 177
  • 2
  • 9
  • pgadmin4 is meant to be used with Postgres database, Why it is installing mysql? You need to check with pgadmin4-apache2 package maintainer. – Murtuza Z Apr 26 '19 at 13:45

0 Answers0