Get fatal error: server could not be contacted when running pgAdmin4. 'NoneType' object has no attribute 'value'
Get fatal error: server could not be contacted when running pgAdmin4. 'NoneType' object has no attribute 'value'
我全新安装了 windows,我正在尝试安装 Postgres 和 pgAdmin4。
我使用默认设置全新安装了所有内容(pgAdmin 4、postrgres 13 等)。当我 运行 pgAdmin 4 时,我收到“致命错误:无法联系服务器”并显示以下消息:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\username\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\username\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_4296_YJZESWNMDVNGRRUO
- 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: pcname
- ComSpec: C:\Windows\system32\cmd.exe
- configsetroot: C:\Windows\ConfigSetRoot
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\username
- LOCALAPPDATA: C:\Users\username\AppData\Local
- LOGONSERVER: \pcname
- NUMBER_OF_PROCESSORS: 8
- NVM_HOME: C:\Users\username\AppData\Roaming\nvm
- NVM_SYMLINK: C:\Program Files\nodejs
- OneDrive: C:\Users\username\OneDrive
- OS: Windows_NT
- Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- PGADMIN_INT_KEY: 2e023387-9c82-4cdd-af2f-c82562c6e4fc
- PGADMIN_INT_PORT: 50567
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 8c01
- 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
- SystemDrive: C:
- SystemRoot: C:\Windows
- TEMP: C:\Users\username\AppData\Local\Temp
- TMP: C:\Users\username\AppData\Local\Temp
- USERDOMAIN: pcname
- USERDOMAIN_ROAMINGPROFILE: pcname
- USERNAME: username
- USERPROFILE: C:\Users\username
- windir: C:\Windows
--------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py", line 98, in <module>
app = create_app()
File "C:\Program Files\PostgreSQL\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\pgAdmin 4\web\pgadmin\setup\db_version.py", line 19, in get_version
return version.value
AttributeError: 'NoneType' object has no attribute 'value'
注意:'username'和'pcname'是我替换实际字符串的占位符,其中一些最初是大写的。
已验证服务“postgresql-x64-13”是 运行ning。尽管尝试了以下操作,我仍然收到此消息:
- 运行 作为管理员。
- 正在删除
C:\Users\username\AppData\Roaming\pgadmin
.
- 将
C:\Program Files\PostgreSQL\bin
添加到 PATH
环境变量(系统和
用户)
- 正在重新启动服务。
- Uninstalling/reinstalling Postgres 13.
- Uninstalling/installing Postgres 12.
- 正在重启我的机器。
产生不同结果的一件事是停止服务,删除 C:\Users\username\AppData\Roaming\pgadmin,重新启动服务,然后 运行ning pg4admin 导致“致命错误”,输出如下:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\username\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\username\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_10312_CHCJAQAYYFQQIAGB
- 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: pcname
- ComSpec: C:\Windows\system32\cmd.exe
- configsetroot: C:\Windows\ConfigSetRoot
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\username
- LOCALAPPDATA: C:\Users\username\AppData\Local
- LOGONSERVER: \pcname
- NUMBER_OF_PROCESSORS: 8
- NVM_HOME: C:\Users\username\AppData\Roaming\nvm
- NVM_SYMLINK: C:\Program Files\nodejs
- OneDrive: C:\Users\username\OneDrive
- OS: Windows_NT
- Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\PostgreSQL\bin;
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- PGADMIN_INT_KEY: cb6cf8e1-ca8b-416b-985f-1fd1a945ff06
- PGADMIN_INT_PORT: 50906
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 8c01
- 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
- SESSIONNAME: Console
- SystemDrive: C:
- SystemRoot: C:\Windows
- TEMP: C:\Users\username\AppData\Local\Temp
- TMP: C:\Users\username\AppData\Local\Temp
- USERDOMAIN: pcname
- USERDOMAIN_ROAMINGPROFILE: pcname
- USERNAME: username
- USERPROFILE: C:\Users\username
- windir: C:\Windows
--------------------------------------------------------
NOTE: Configuring authentication for DESKTOP mode.
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py", line 91, in <module>
exec(open(file_quote(setup_py), 'r').read())
File "<string>", line 506, in <module>
File "<string>", line 378, in setup_db
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\__init__.py", line 351, in create_app
db_upgrade(app)
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade
flask_migrate.upgrade(migration_folder)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 96, in wrapped
f(*args, **kwargs)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 271, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\command.py", line 294, in upgrade
script.run_env()
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\script\base.py", line 490, in run_env
util.load_python_file(self.dir, "env.py")
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\util\pyfiles.py", line 97, in load_python_file
module = load_module_py(module_id, path)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\util\compat.py", line 182, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 93, in <module>
run_migrations_online()
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 86, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\runtime\environment.py", line 813, in run_migrations
self.get_context().run_migrations(**kw)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\runtime\migration.py", line 561, in run_migrations
step.migration_fn(**kw)
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\migrations\versions\fdc58d9bd449_.py", line 122, in upgrade
Security(current_app, user_datastore, register_blueprint=False)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1062, in __init__
self._state = self.init_app(
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1102, in init_app
self._state = state = _get_state(app, datastore, **kwargs)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 608, in _get_state
remember_token_serializer=_get_serializer(app, "remember"),
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 593, in _get_serializer
return URLSafeTimedSerializer(secret_key=secret_key, salt=salt)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\itsdangerous\serializer.py", line 104, in __init__
self.secret_keys: _t.List[bytes] = _make_keys_list(secret_key)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\itsdangerous\signer.py", line 64, in _make_keys_list
return [want_bytes(s) for s in secret_key]
TypeError: 'NoneType' object is not iterable
我最近在另一台机器上安装了它,没有任何问题。新构建会有问题似乎很奇怪。几乎让我觉得我缺少旧版本包含的东西(python?),尽管事实并非如此。有很多关于此的帖子,我已经尝试了其中建议的所有内容,但没有解决。
正如 Delsx 在评论中指出的那样,可以安装独立的 pgAdmin 而不会出现 pgadmin.org/download. It appears this is a widespread bug that has been reported on the pgAdmin bug list, here and here
中的相同问题
最终对我有用的解决方案是:
- 删除 C:\Users\username\AppData\Roaming\pgadmin
- 打开终端和运行 C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py文件使用python
Terminal view -> python execution
- 运行 以管理员身份从 windows 菜单中运行“pgAdmin 4”应用程序,它将按预期工作
我也有这个问题。
我遵循了 nonethewiser 的建议答案,安装了独立的 pgAdmin。
删除 Roaming/pgadmin 并以管理员身份启动后,它不起作用。
我再次尝试了捆绑的 pgAdmin,但奇怪的是它有效。
适合我的解决方案:
在以下位置下载 pgAdmin4:
https://www.postgresql.org/ftp/pgadmin/pgadmin4/v5.2/windows/
下载 Sql 服务器:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
设置时取消勾选install pgAdmin 4 and StackBuilder。
我一直在搜索这个问题,我做了以下事情
- 删除 C:\Users\username\AppData\Roaming\pgadmin 文件夹
- 添加下一个windows用户环境变量
SQLITE_PATH = C:\Users\*YourUsername*\AppData\Roaming\pgadmin\pgadmin4.db
- 在 C:\Program Files\pgAdmin 4\v5\web 和 运行 中打开 cmd python setup.py文件
- 安装所有缺少的依赖项
- 一旦 setup.py 成功完成,您应该再次从 AppData 中删除 pgadmin 文件夹
- 运行 setup.py再来一次
- 正常打开 pgAdming4(不是以管理员身份)
这个解决方法对我有用
我的设置是 PostgreSQL 9.6、pgAdmin4 v5.3 和 Python 3.9.5
这个解决方案对我有用:
仅从您的系统中删除 pgAdmin4(在单个组件卸载模式下)。
然后在以下位置下载并安装 pgAdmin4:https://www.postgresql.org/ftp/pgadmin/pgadmin4/v5.2/windows/
删除 C:\Users*您的用户名*\AppData\Roaming\pgadmin
运行 PgAdmin4
如果连独立的 pgAdmin4 exe 都不起作用,请转到 python 虚拟环境(如果没有,请使用 pip 安装)。在虚拟环境中安装 pgAdmin 包(pip install pgadmin4)。导航到 C:\Users(用户名)\Envs(或您各自的环境文件夹)\test(或您各自的环境名称)\Lib\site-packages\pgadmin4\pgAdmin4.py。
万一 运行 将 py 文件 运行 放入 cheroot 模块时找不到 fot,然后在虚拟环境中安装 pip install cheroot 就大功告成了。
请记住在执行此操作之前激活环境。为了方便起见,在两个单独的 cmd windows 中执行此操作。
即使 exe 不工作,上面提到的程序肯定能工作。
同时验证 postgresql 正在监听端口:5432 否则更改 postgresql.conf
中的端口
我在 Linux Elementary OS 上遇到了这个问题,解决我的问题的方法是从端口 5432[= configure PgAdmin 到另一个端口,如 5437 因为 pgAdmin 在端口 5432 开始有冲突,Postgres 已经在使用它
我全新安装了 windows,我正在尝试安装 Postgres 和 pgAdmin4。 我使用默认设置全新安装了所有内容(pgAdmin 4、postrgres 13 等)。当我 运行 pgAdmin 4 时,我收到“致命错误:无法联系服务器”并显示以下消息:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\username\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\username\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_4296_YJZESWNMDVNGRRUO
- 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: pcname
- ComSpec: C:\Windows\system32\cmd.exe
- configsetroot: C:\Windows\ConfigSetRoot
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\username
- LOCALAPPDATA: C:\Users\username\AppData\Local
- LOGONSERVER: \pcname
- NUMBER_OF_PROCESSORS: 8
- NVM_HOME: C:\Users\username\AppData\Roaming\nvm
- NVM_SYMLINK: C:\Program Files\nodejs
- OneDrive: C:\Users\username\OneDrive
- OS: Windows_NT
- Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- PGADMIN_INT_KEY: 2e023387-9c82-4cdd-af2f-c82562c6e4fc
- PGADMIN_INT_PORT: 50567
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 8c01
- 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
- SystemDrive: C:
- SystemRoot: C:\Windows
- TEMP: C:\Users\username\AppData\Local\Temp
- TMP: C:\Users\username\AppData\Local\Temp
- USERDOMAIN: pcname
- USERDOMAIN_ROAMINGPROFILE: pcname
- USERNAME: username
- USERPROFILE: C:\Users\username
- windir: C:\Windows
--------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py", line 98, in <module>
app = create_app()
File "C:\Program Files\PostgreSQL\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\pgAdmin 4\web\pgadmin\setup\db_version.py", line 19, in get_version
return version.value
AttributeError: 'NoneType' object has no attribute 'value'
注意:'username'和'pcname'是我替换实际字符串的占位符,其中一些最初是大写的。
已验证服务“postgresql-x64-13”是 运行ning。尽管尝试了以下操作,我仍然收到此消息:
- 运行 作为管理员。
- 正在删除
C:\Users\username\AppData\Roaming\pgadmin
. - 将
C:\Program Files\PostgreSQL\bin
添加到PATH
环境变量(系统和 用户) - 正在重新启动服务。
- Uninstalling/reinstalling Postgres 13.
- Uninstalling/installing Postgres 12.
- 正在重启我的机器。
产生不同结果的一件事是停止服务,删除 C:\Users\username\AppData\Roaming\pgadmin,重新启动服务,然后 运行ning pg4admin 导致“致命错误”,输出如下:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\username\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\username\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_10312_CHCJAQAYYFQQIAGB
- 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: pcname
- ComSpec: C:\Windows\system32\cmd.exe
- configsetroot: C:\Windows\ConfigSetRoot
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\username
- LOCALAPPDATA: C:\Users\username\AppData\Local
- LOGONSERVER: \pcname
- NUMBER_OF_PROCESSORS: 8
- NVM_HOME: C:\Users\username\AppData\Roaming\nvm
- NVM_SYMLINK: C:\Program Files\nodejs
- OneDrive: C:\Users\username\OneDrive
- OS: Windows_NT
- Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\username\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\PostgreSQL\bin;
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- PGADMIN_INT_KEY: cb6cf8e1-ca8b-416b-985f-1fd1a945ff06
- PGADMIN_INT_PORT: 50906
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 8c01
- 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
- SESSIONNAME: Console
- SystemDrive: C:
- SystemRoot: C:\Windows
- TEMP: C:\Users\username\AppData\Local\Temp
- TMP: C:\Users\username\AppData\Local\Temp
- USERDOMAIN: pcname
- USERDOMAIN_ROAMINGPROFILE: pcname
- USERNAME: username
- USERPROFILE: C:\Users\username
- windir: C:\Windows
--------------------------------------------------------
NOTE: Configuring authentication for DESKTOP mode.
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py", line 91, in <module>
exec(open(file_quote(setup_py), 'r').read())
File "<string>", line 506, in <module>
File "<string>", line 378, in setup_db
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\__init__.py", line 351, in create_app
db_upgrade(app)
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade
flask_migrate.upgrade(migration_folder)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 96, in wrapped
f(*args, **kwargs)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 271, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\command.py", line 294, in upgrade
script.run_env()
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\script\base.py", line 490, in run_env
util.load_python_file(self.dir, "env.py")
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\util\pyfiles.py", line 97, in load_python_file
module = load_module_py(module_id, path)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\util\compat.py", line 182, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 93, in <module>
run_migrations_online()
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 86, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\runtime\environment.py", line 813, in run_migrations
self.get_context().run_migrations(**kw)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\alembic\runtime\migration.py", line 561, in run_migrations
step.migration_fn(**kw)
File "C:\Program Files\PostgreSQL\pgAdmin 4\web\migrations\versions\fdc58d9bd449_.py", line 122, in upgrade
Security(current_app, user_datastore, register_blueprint=False)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1062, in __init__
self._state = self.init_app(
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1102, in init_app
self._state = state = _get_state(app, datastore, **kwargs)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 608, in _get_state
remember_token_serializer=_get_serializer(app, "remember"),
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 593, in _get_serializer
return URLSafeTimedSerializer(secret_key=secret_key, salt=salt)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\itsdangerous\serializer.py", line 104, in __init__
self.secret_keys: _t.List[bytes] = _make_keys_list(secret_key)
File "C:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\itsdangerous\signer.py", line 64, in _make_keys_list
return [want_bytes(s) for s in secret_key]
TypeError: 'NoneType' object is not iterable
我最近在另一台机器上安装了它,没有任何问题。新构建会有问题似乎很奇怪。几乎让我觉得我缺少旧版本包含的东西(python?),尽管事实并非如此。有很多关于此的帖子,我已经尝试了其中建议的所有内容,但没有解决。
正如 Delsx 在评论中指出的那样,可以安装独立的 pgAdmin 而不会出现 pgadmin.org/download. It appears this is a widespread bug that has been reported on the pgAdmin bug list, here and here
中的相同问题最终对我有用的解决方案是:
- 删除 C:\Users\username\AppData\Roaming\pgadmin
- 打开终端和运行 C:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py文件使用python
Terminal view -> python execution
- 运行 以管理员身份从 windows 菜单中运行“pgAdmin 4”应用程序,它将按预期工作
我也有这个问题。 我遵循了 nonethewiser 的建议答案,安装了独立的 pgAdmin。 删除 Roaming/pgadmin 并以管理员身份启动后,它不起作用。 我再次尝试了捆绑的 pgAdmin,但奇怪的是它有效。
适合我的解决方案:
在以下位置下载 pgAdmin4: https://www.postgresql.org/ftp/pgadmin/pgadmin4/v5.2/windows/ 下载 Sql 服务器: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads 设置时取消勾选install pgAdmin 4 and StackBuilder。
我一直在搜索这个问题,我做了以下事情
- 删除 C:\Users\username\AppData\Roaming\pgadmin 文件夹
- 添加下一个windows用户环境变量
SQLITE_PATH = C:\Users\*YourUsername*\AppData\Roaming\pgadmin\pgadmin4.db
- 在 C:\Program Files\pgAdmin 4\v5\web 和 运行 中打开 cmd python setup.py文件
- 安装所有缺少的依赖项
- 一旦 setup.py 成功完成,您应该再次从 AppData 中删除 pgadmin 文件夹
- 运行 setup.py再来一次
- 正常打开 pgAdming4(不是以管理员身份)
这个解决方法对我有用
我的设置是 PostgreSQL 9.6、pgAdmin4 v5.3 和 Python 3.9.5
这个解决方案对我有用:
仅从您的系统中删除 pgAdmin4(在单个组件卸载模式下)。
然后在以下位置下载并安装 pgAdmin4:https://www.postgresql.org/ftp/pgadmin/pgadmin4/v5.2/windows/
删除 C:\Users*您的用户名*\AppData\Roaming\pgadmin
运行 PgAdmin4
如果连独立的 pgAdmin4 exe 都不起作用,请转到 python 虚拟环境(如果没有,请使用 pip 安装)。在虚拟环境中安装 pgAdmin 包(pip install pgadmin4)。导航到 C:\Users(用户名)\Envs(或您各自的环境文件夹)\test(或您各自的环境名称)\Lib\site-packages\pgadmin4\pgAdmin4.py。 万一 运行 将 py 文件 运行 放入 cheroot 模块时找不到 fot,然后在虚拟环境中安装 pip install cheroot 就大功告成了。 请记住在执行此操作之前激活环境。为了方便起见,在两个单独的 cmd windows 中执行此操作。
即使 exe 不工作,上面提到的程序肯定能工作。
同时验证 postgresql 正在监听端口:5432 否则更改 postgresql.conf
中的端口我在 Linux Elementary OS 上遇到了这个问题,解决我的问题的方法是从端口 5432[= configure PgAdmin 到另一个端口,如 5437 因为 pgAdmin 在端口 5432 开始有冲突,Postgres 已经在使用它