gpt4 book ai didi

python - 如何在 Ubuntu 上安装 pgadmin4

转载 作者:行者123 更新时间:2023-12-04 04:15:21 25 4
gpt4 key购买 nike

我正在尝试在 ubuntu vps 服务器上安装 pgadmin4,但我无法安装。我收到这个错误

postgres 版本 12.2Ubuntu 版本 18.04

无法找出这个错误,任何帮助将不胜感激尝试了一切但没有奏效

Setting up pgadmin4-apache2 (4.18-1.pgdg18.04+1) ...
apache2_invoke pgadmin4: already enabled
Traceback (most recent call last):
File "setup.py", line 413, in <module>
setup_db()
File "setup.py", line 347, in setup_db
app = create_app()
File "/usr/share/pgadmin4/web/pgadmin/__init__.py", line 400, in create_app
driver.init_app(app)
File "/usr/share/pgadmin4/web/pgadmin/utils/driver/__init__.py", line 40, in init_app
DriverRegistry.load_drivers()
File "/usr/share/pgadmin4/web/pgadmin/utils/driver/registry.py", line 88, in load_drivers
module = import_module(module_name)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/share/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py", line 28, in <module>
from .server_manager import ServerManager
File "/usr/share/pgadmin4/web/pgadmin/utils/driver/psycopg2/server_manager.py", line 30, in <module>
from sshtunnel import SSHTunnelForwarder, BaseSSHTunnelForwarderError
File "/usr/lib/python3/dist-packages/sshtunnel.py", line 25, in <module>
import paramiko
File "/usr/lib/python3/dist-packages/paramiko/__init__.py", line 30, in <module>
from paramiko.transport import SecurityOptions, Transport
File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 66, in <module>
from paramiko.sftp_client import SFTPClient
File "/usr/lib/python3/dist-packages/paramiko/sftp_client.py", line 41, in <module>
from paramiko.sftp_file import SFTPFile
File "/usr/lib/python3/dist-packages/paramiko/sftp_file.py", line 66
self._close(async=True)
^
SyntaxError: invalid syntax
dpkg: error processing package pgadmin4-apache2 (--configure):
installed pgadmin4-apache2 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
pgadmin4-apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)

最佳答案

我的解决方案是显式安装包 python3-paramiko:

apt-get install python3-paramiko

结果:

Preparing to unpack .../python3-paramiko_2.6.0-2_all.deb ...
Unpacking python3-paramiko (2.6.0-2) over (2.0.0-1ubuntu1.2) ...
Setting up python3-bcrypt (3.1.7-2ubuntu1) ...
Setting up python3-cryptography (2.8-3ubuntu0.1) ...
Setting up pgadmin4-apache2 (4.25-1.pgdg20.04+1) ...
pgAdmin 4 - Application Initialisation
======================================

Setting up python3-nacl (1.3.0-5) ...
Setting up python3-paramiko (2.6.0-2) ...

在从 18.04 到 20.04 的版本升级期间发生。错误回溯是一样的。

关于python - 如何在 Ubuntu 上安装 pgadmin4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60788137/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com