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.
我发现无法联系到pgadmin 4服务器。这是我第一次在我的电脑上安装。我尝试了以管理员身份运行解决方案,删除了应用程序/漫游文件,重新启动了posgresql服务,尝试修改了config.py、config_disro.py文件。所有这些都无济于事。请帮帮忙,谢谢。
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:
运行时配置文件:“C:\Users\lco73\AppData\Roaming\pgadmin\runtime_config.json”pgAdmin配置文件:“C:\Program Files\postgreSQL\12\pgAdmin 4\WEB\config.py”Webapp路径:“C:\Program Files\postgreSQL\12\pgAdmin 4\Web\pgAdmin4.py”pgAdmin命令:“C:\Program Files\postgreSQL\12\pgAdmin 4\python\python.EXE-S C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py“环境:
- 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'
Traceback(最近一次调用):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've been struggling with this problem for quite sometime.
我与这个问题斗争了很长一段时间。
Here's the steps you have to follow for Windows:
以下是您在Windows上必须遵循的步骤:
- Go To Add or Remove programs, you can find this in search
- Search for postgreSQL
- Click on uninstall and when promoted click something like "individual components"
- Click on PgAdmin4 and uninstall it.
- Once step 4 is done then run pgAdmin as administrator. MAKE SURE TO RUN AS ADMINISTRATOR that's the only time it worked for me
Simply delete C:\Users%USERNAME%\AppData\Roaming\pgAdmin\ and then install pgAdmin 4
只需删除C:\USERS%USERNAME%\AppData\Roaming\pgAdmin\,然后安装pgAdmin 4
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 terminal. It will list down the module missing when you run. Install the modules and run again to see which other module is missing. Or you can use an IDE that can check which module that is not install in the _ init _.py files in the "PostgreSQL\pgAdmin 4\web\pgadmin" folder.
我找到了解决方案,如果你是第一次使用PostgreSQL和新的SQL东西,可能有一些Python模块没有安装。转到文件夹C:(您的用户文件夹)\PostgreSQL\pgAdmin4\web并使用终端运行setup.py。当您运行时,它将列出缺少的模块。安装模块并再次运行以查看缺少哪个其他模块。或者,您可以使用IDE来检查哪个模块没有安装在“PostgreSQL\pgAdmin 4\web\pgadmin”文件夹中的_init_.py文件中。
I did this and it started working in Windows 10
.
我这样做了,它开始在Windows10下运行。
Go to Control Panel
-> Programs & Features
-> Right click PostgreSQL 15
(whichever version you have installed) -> Uninstall / Change
-> Individual Components
-> select pgAdmin
-> Click next and wait for uninstall to complete.
转到控制面板->程序和功能->右键单击PostgreSQL 15(无论您安装了哪个版本)->删除/更改->单个组件->选择pgAdmin ->单击下一步并等待卸载完成。
Now download pgAdmin
latest version and install and start using it.
现在下载pgAdmin最新版本并安装并开始使用它。
Another aspect:
另一个方面:
- Just go to environment variables in windows cPanel.
- Open Path variable
- Check if there any C:\Program Files\PostgreSQL values
- Remove them, and restart pgAdmin.
I faced the issue "The pgAdmin 4 server could not be contacted" when re-installing PostgreSql on a Windows 7 machine that I need to keep using for certain reasons.
我在Windows 7机器上重新安装PostgreSQL时遇到了“无法联系pgAdmin 4服务器”的问题,由于某些原因,我需要继续使用。
Obviously Windows 7 is not supported anymore in newer PostgreSQL 10-versions. Seems to be an issue with a missing flask-Module of the Python framework that is delivered with pgAdmin, perhaps the reason behind is the VPN I'm working in doesn't allow to download modules. Didn't get deeper into it.
显然,在较新的PostgreSQL10版本中不再支持Windows 7。似乎是缺少随pgAdmin提供的Python框架的flask模块的问题,可能背后的原因是我正在工作的VPN不允许下载模块。没有更深入地了解它。
First tried to run version 10.20-2 x64. Later it turned out that older version 10.12-2 x64 is working on Windows 7.
Searched on the net for a download of older postgresql-10.12-2-windows-x64.exe, found it here https://soft.uclv.edu.cu/Postgres/
第一次尝试运行版本10.20-2x64。后来发现,旧版本10.12-2 x64在Windows7上运行。在网上搜索旧的postgresql-10.12-2-WINDOWS-x64.exe的下载,在https://soft.uclv.edu.cu/Postgres/找到它
Also see
https://www.pgadmin.org/download/pgadmin-4-windows/
另请参阅https://www.pgadmin.org/download/pgadmin-4-windows/
"pgAdmin is available for 64 bit Windows™ 7 SP1 (desktop) or 2008R2 (server) and above, up to v4.30."
PgAdmin适用于64位WindowsWindows7SP1(台式机)或2008R2(服务器)及更高版本,最高版本为v4.30。
Solution:: "The pgAdmin 4 server could not be contacted:" error served to you if you are using Postgre SQL for the first time. Some Python libraries are missing from your system. Try to install those libraries first in the "C:\Program Files\PostgreSQL\14\pgAdmin 4\web" root folder using the window or any other terminal. And then restart the Postgre\PgAdmin4. The fatal error will be resolved.
解决方案:“无法联系pgAdmin 4服务器:”如果您是第一次使用Postgre SQL,则会出现错误。您的系统中缺少某些Python库。尝试使用Windows或任何其他终端首先在“C:\Program Files\PostgreSQL\14\pgAdmin 4\web”根文件夹中安装这些库。然后重新启动postgre\PgAdmin4。致命错误将得到解决。
Got a same error. After reinstalling the whole thing and trying the other solutions I basically on did the following:
得到了相同的错误。在重新安装了整个系统并尝试了其他解决方案后,我基本上做到了以下几点:
- Installing Python
- Cleaning the %temp% file.
On me, It seems the problem was that pgAdmin could not select a free port randomly and I put it a fixed one, not used in "netstat -a" list, and pgAdmin has started.
在我看来,问题似乎是pgAdmin不能随机选择一个空闲端口,我把它放在一个固定的端口上,不在“netstat-a”列表中使用,pgAdmin已经启动。
Restart my computer worked for me
重新启动我的计算机对我有效
Select configure, uncheck Fixed Port, and then restart the program. It worked for me by doing it.
选择配置,取消选中固定端口,然后重新启动程序。它为我工作,这样做。
Is correct for my try everythin mentione here and work it, becouse I try one per one and no work it so I when to do everthin mentionate here
, I was unistalla PGADMIN Uninstall / Change -> Individual Components , after delete this director C:\Users%USERNAME%\AppData\Roaming\pgAdmin\ , and then delete all file of pgadmin on the previos installation. and then donwload pgamdin recent version. finally works it
是正确的,我尝试了这里提到的每一个和它工作,因为我尝试了一个一个,但没有工作,所以我什么时候做所有提到的,我是卸载了PGADMIN卸载/更改->个别组件,在删除这个导演C:\USERS%USERNAME%\AppData\Roaming\pgAdmin\,然后删除所有文件的pgadmin在以前的安装。然后在最新版本中加载pGamin。终于成功了
更多回答
This did it for me 2023
这对我来说是2023年的事
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
正如它目前所写的,你的答案并不清楚。请编辑以添加更多详细信息,以帮助其他人了解这是如何解决提出的问题的。你可以在帮助中心找到更多关于如何写出好答案的信息。
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
就目前所写的,你的答案还不清楚。请编辑以添加其他详细信息,以帮助其他人理解这是如何解决所问问题的。你可以在帮助中心找到更多关于如何写好答案的信息。
我是一名优秀的程序员,十分优秀!