The same thing happened to me today:

And this is how I decided it:
1) Use a text editor to open the config_distro.py file in the c: \ Program Files \ pgAdmin 4 \ v1 \ web section. >. Change the value of SERVER_MODE from True to False, and then save the change. (I launched Notepad ++ as an administrator to be able to save to this protected folder.)

2) Go to the folder c: \ Users \ your_name \ AppData \ Roaming \ pgAdmin and make sure that there is nothing there (delete all the files, since they are temporary and will be restored after pgAdmin is launched )

3) Start pgAdmin

4) This time you will see a white box that sits at least on my slow laptop - about 20 seconds. (You can briefly review the original error message, but donβt worry.)

5) In the meantime, temporary files are created that are necessary to run the application.

6) As soon as the process of temporary files is completed, the application starts as expected.

source share