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:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\lco73\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_2976_GCSFUFUNDXSUIDKX
- CHROME_RESTART: NW.js|Whoa! NW.js has crashed. Relaunch now?|LEFT_TO_RIGHT
- CommonProgramFiles: C:\Program Files\Common Files
- CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
- CommonProgramW6432: C:\Program Files\Common Files
- COMPUTERNAME: CHENONN
- ComSpec: C:\Windows\system32\cmd.exe
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\lco73
- JAVA_HOME: C:\Users\lco73\AppData\Local\Programs\AdoptOpenJDK\jdk-11.0.10.9-hotspot\
- LOCALAPPDATA: C:\Users\lco73\AppData\Local
- LOGONSERVER: \CHEO
- M2_HOME: C:\Program Files\apache-maven-3.6.3
- MAVEN_HOME: C:\Program Files\apache-maven-3.6.3
- NUMBER_OF_PROCESSORS: 16
- OneDrive: C:\Users\lco73\OneDrive
- OneDriveConsumer: C:\Users\lco73\OneDrive
- OS: Windows_NT
- Path: C:\Users\lco73\introcs\java\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\MATLAB\R2018a\runtime\win64;C:\Program Files\MATLAB\R2018a\bin;C:\Program Files\MATLAB\MATLAB Runtime\v96\runtime\win64;C:\Program Files\apache-maven-3.6.3\bin;C:\Program Files\apache-maven-3.6.3\bin;C:\Program Files\TMC-cli;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\lco73\anaconda3;C:\Users\lco73\anaconda3\Library\mingw-w64\bin;C:\Users\lco73\anaconda3\Library\usr\bin;C:\Users\lco73\anaconda3\Library\bin;C:\Users\lco73\anaconda3\Scripts;C:\Users\lco73\AppData\Local\Programs\AdoptOpenJDK\jdk-11.0.10.9-hotspot\bin;C:\Users\lco73\introcs\j3d\bin;C:\Users\lco73\introcs\bin;C:\Users\lco73\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- pgAdmin: C:\Program Files\PostgreSQL\12\pgAdmin 4\bin
- PGADMIN_INT_KEY: de63dec9-3578-472a-af02-2786fce52e26
- PGADMIN_INT_PORT: 63995
- PGADMIN_SERVER_MODE: OFF
- postgreSQL: C:\Program Files\PostgreSQL\12\bin
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 165 Stepping 5, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: a505
- ProgramData: C:\ProgramData
- ProgramFiles: C:\Program Files
- ProgramFiles(x86): C:\Program Files (x86)
- ProgramW6432: C:\Program Files
- PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
- PUBLIC: C:\Users\Public
- PyCharm Community Edition: C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin;
- PYTHONPATH: C:\Users\lco73\Desktop\Python\Convolutional_neural_network-master
- SystemDrive: C:
- SystemRoot: C:\Windows
- TEMP: C:\Users\lco73\AppData\Local\Temp
- TMP: C:\Users\lco73\AppData\Local\Temp
- USERDOMAIN: CHENONN
- USERDOMAIN_ROAMINGPROFILE: CHENONN
- USERNAME: lco73
- USERPROFILE: C:\Users\lco73
- windir: C:\Windows
- ZES_ENABLE_SYSMAN: 1
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'
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.