title: How to fix "pgadmin4-apache2" error in Ubuntu 18.04 command line installation
body: <p>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? </p>
  
  <p>I tried installing the following packages, of which all failed:</p>
  
  <pre><code>pip3 install python-mysql
  sudo apt install mysql-client-core-5.7
  sudo apt-get install python3.7-dev libmysqlclient-dev
  
  </code></pre>
  
  <p>The error I am getting is the following:</p>
  
  <pre><code>Setting up pgadmin4-apache2 (4.5-1.pgdg18.04+1) ...
  Traceback (most recent call last):
    File "setup.py", line 17, in &lt;module&gt;
      from pgadmin.model import db, User, Version, ServerGroup, Server, \
    File "/usr/share/pgadmin4/web/pgadmin/__init__.py", line 38, in &lt;module&gt;
      from pgadmin.setup import get_version, set_version
    File "/usr/share/pgadmin4/web/pgadmin/setup/__init__.py", line 12, in &lt;module&gt;
      from .db_upgrade import db_upgrade
    File "/usr/share/pgadmin4/web/pgadmin/setup/db_upgrade.py", line 11, in &lt;module&gt;
      import flask_migrate
    File "/usr/lib/python3/dist-packages/flask_migrate/__init__.py", line 8, in &lt;module&gt;
      from alembic import __version__ as __alembic_version__
    File "/usr/lib/python3/dist-packages/alembic/__init__.py", line 9, in &lt;module&gt;
      from . import context  # noqa
    File "/usr/lib/python3/dist-packages/alembic/context.py", line 1, in &lt;module&gt;
      from .runtime.environment import EnvironmentContext
    File "/usr/lib/python3/dist-packages/alembic/runtime/environment.py", line 2, in &lt;module&gt;
      from .migration import MigrationContext
    File "/usr/lib/python3/dist-packages/alembic/runtime/migration.py", line 12, in &lt;module&gt;
      from .. import ddl, util
    File "/usr/lib/python3/dist-packages/alembic/ddl/__init__.py", line 1, in &lt;module&gt;
      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
  
  </code></pre>
  
  <p>I'm not entirely sure why the installation of "pgadmin4-apache2" happenings every time as well.</p>
  
  <p>In an attempt to solve this issue I did the following:</p>
  
  <pre><code>sudo apt-get purge pgadmin4-apache2
  
  </code></pre>
  
  <p>This failed to complete, but despite it's failure I attempted to reinstall "pgadmin4-apache2", but again encountered the error.</p>
  
  <pre><code>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)
  
  
  </code></pre>
  
  <p>This error is hindering me from installing any additional packages.</p>