1

我已经安装了 PostgreSQL 9.6,我正在尝试设置 PGAdmin4。我正在使用 Linux Mint 17.3。为了设置它,我运行了以下命令:

1)我确保sudo apt-get install python-dev跑步sudo apt-get install libpq-dev

1)在我的主目录中,我运行了命令:virtualenv pgadmin4

2)我改成目录:cd pgadmin4

3)我激活了我的虚拟环境:source bin/activate

4)我运行以下命令来检索 Python 轮:wget https://ftp.postgresql.org/pub/pgadmin3/pgadmin4/v1.1/pip/pgadmin4-1.1-py2-none-any.whl

5) 我将 pgadmin4 及其所有依赖项安装到我的虚拟环境中:pip install pgadmin4-1.1-py2-none-any.whl

6)我编辑config_local.py包括SERVER_MODE = False

7)我运行了命令:python ./lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

然后我得到以下回溯:

Traceback (most recent call last):
  File "./lib/python2.7/site-packages/pgadmin4/pgAdmin4.py", line 46, in <module>
    app = create_app()
  File "/home/samuel/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/__init__.py", line 241, in create_app
    driver.init_app(app)
  File "/home/samuel/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/utils/driver/__init__.py", line 40, in init_app
    DriverRegistry.load_drivers()
  File "/home/samuel/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/utils/driver/registry.py", line 88, in load_drivers
    module = import_module(module_name)
  File "/home/samuel/pgadmin4/lib/python2.7/site-packages/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/samuel/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg2/__init__.py", line 23, in <module>
    import psycopg2
  File "/home/samuel/pgadmin4/lib/python2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: /home/samuel/pgadmin4/lib/python2.7/site-packages/psycopg2/_psycopg.so: undefined symbol: PyMemoryView_Type

我一直在研究这个问题的解决方案一段时间,但我无法通过我的谷歌搜索找到任何东西。知道我需要做什么才能让 pgadmin4 运行吗?

4

1 回答 1

0

我想通了。我的系统默认配置为使用 Python 2.6,因此我使用了错误的解释器。

解决方案是运行:

python2.7 ./lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

代替:

python ./lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
于 2016-12-07T12:44:47.230 回答