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

Leo*_*Onn 6 windows pgadmin-4

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 admin solution, remove the app/roaming files, restart the posgresql services, tried to modify the config.py, config_distro.py. All of it did not help. Please help thank you.

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

回溯(最近一次调用最后):文件“C:\ Program Files \ PostgreSQL \ 12 \ pgAdmin 4 \ web \ pgAdmin4.py”,第98行,在app = create_app()文件“C:\ Program Files \ PostgreSQL \ 12”中\pgAdmin 4\web\pgadmin_ init _.py",第 347 行,在 create_app 中,如果不是 os.path.exists(SQLITE_PATH) 或 get_version() == -1:文件“C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgadmin\setup\db_version.py",第 19 行,在 get_version 返回 version.value AttributeError: 'NoneType' 对象没有属性 'value'

小智 7

我已经为这个问题苦苦挣扎了一段时间了。

对于 Windows,您必须遵循以下步骤:

  1. 转到“添加或删除程序”,您可以在搜索中找到它
  1. 搜索 postgreSQL
  1. 单击“卸载”,然后在升级时单击“单个组件”之类的内容
  1. 单击 PgAdmin4 并将其卸载。
  1. 完成步骤 4 后,以管理员身份运行 pgAdmin。确保以管理员身份运行,这是它唯一对我有用的一次


Leo*_*Onn 1

我找到了解决方案,如果你是第一次使用 PostgreSQL 并且对 SQL 不熟悉,可能有一些 python 模块没有安装。转到文件夹 C:(YourUserFolder)\PostgreSQL\pgAdmin 4\web 并使用终端运行 setup.py。它会列出运行时缺少的模块。安装模块并再次运行以查看缺少哪个其他模块。或者您可以使用 IDE 来检查“PostgreSQL\pgAdmin 4\web\pgadmin”文件夹中的_ init _.py 文件中未安装的模块。