windowspgadmin-4

Fatal Error The pgAdmin 4 server could not be contacted (already tried solution in other thread)


I get the pgAdmin 4 server could not be contacted. This is the first time I installed on my computer. I tried the run as administrator solution, remove the app/roaming files, restart the PostgreSQL services, tried to modify the config.py and config_distro.py files. All of it did not help. How can I fix it?

Here is the error:

pgAdmin Runtime Environment

Python Path: "C:\Program Files\PostgreSQL\12\pgAdmin 4\python\python.exe" Runtime Config File: "C:\Users\lco73\AppData\Roaming\pgadmin\runtime_config.json" pgAdmin Config File: "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\config.py" Webapp Path: "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py" pgAdmin Command: "C:\Program Files\PostgreSQL\12\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py" Environment:


Traceback (most recent call last): File "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py", line 98, in app = create_app() File "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgadmin_init_.py", line 347, in create_app if not os.path.exists(SQLITE_PATH) or get_version() == -1: File "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgadmin\setup\db_version.py", line 19, in get_version return version.value AttributeError: 'NoneType' object has no attribute 'value'


Solution

  • I found the solution. If you are first time using PostgreSQL and new to SQL stuff, probably there is some Python module not installed.

    Go to the folder C:(YourUserFolder)\PostgreSQL\pgAdmin 4\web and run setup.py using the terminal.

    It will list down the modules missing when you run. Install the modules and run again to see which other modules are missing. Or you can use an IDE that can check which module that is not installed in the _ init _.py files in the "PostgreSQL\pgAdmin 4\web\pgadmin" folder.