Skip to content

simple buildbot_1 fails with ImportError: No module named psycopg2 #9

@akuanti

Description

@akuanti

When running docker-compose up with the simple example, I get the following over and over:

buildbot_1  | checking for running master
buildbot_1  | checking master.cfg
buildbot_1  | upgrading basedir
buildbot_1  | upgrading database (postgresql+psycopg2://buildbot:xxxx@db/buildbot)
buildbot_1  | Can't upgrade master yet. Waiting for database ready?
buildbot_1  | checking basedir
buildbot_1  | /usr/lib/python2.7/site-packages/buildbot/config.py:102: ConfigWarning: [0.9.0 and later] `buildbotNetUsageData` is not configured and defaults to
basic.
buildbot_1  | This parameter helps the buildbot development team to understand the installation base.
buildbot_1  | No personal information is collected.
buildbot_1  | Only installation software version info and plugin usage is sent.
buildbot_1  | You can `opt-out` by setting this variable to None.
buildbot_1  | Or `opt-in` for more information by setting it to "full".
buildbot_1  |
buildbot_1  |   category=ConfigWarning,
buildbot_1  | /usr/lib/python2.7/site-packages/buildbot/config.py:102: ConfigWarning: [0.9.0 and later] NOTE: `status` targets are deprecated and ignored They are replaced by reporters
buildbot_1  |   category=ConfigWarning,
buildbot_1  | problem while upgrading!:
buildbot_1  | Traceback (most recent call last):
buildbot_1  |   File "/usr/lib/python2.7/site-packages/buildbot/scripts/upgrade_master.py", line 121, in _upgradeMaster
buildbot_1  |     yield upgradeDatabase(config, master_cfg)
buildbot_1  | ImportError: No module named psycopg2

I tried installing psycopg2 manually, but it fails because it can't find the pg_config executable.

/var/lib/buildbot # pip install psycopg2
Collecting psycopg2
  Downloading https://files.pythonhosted.org/packages/74/83/51580322ed0e82cba7ad8e0af590b8fb2cf11bd5aaa1ed872661bd36f462/psycopg2-2.7.4.tar.gz (425kB)
    100% |████████████████████████████████| 430kB 4.4MB/s
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Q8qcHR/psycopg2/

When I try to install psycopg2-binary, it still tries to build from source (I'm guessing because none of the wheels are compatible?).

/var/lib/buildbot # pip install psycopg2-binary
Collecting psycopg2-binary
  Downloading https://files.pythonhosted.org/packages/77/09/4991fcd9a8f4bea1ee3948e1729fa17c184d25bd10809bacc143626361b9/psycopg2-binary-2.7.4.tar.gz (426kB)
    100% |████████████████████████████████| 430kB 6.4MB/s
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2_binary.egg-info
    writing pip-egg-info/psycopg2_binary.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2_binary.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2_binary.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2_binary.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-2kFAwj/psycopg2-binary/

I believe that libpq-dev needs to be installed: http://initd.org/psycopg/docs/install.html#build-prerequisites for this installation to work properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions