python - 如何根据 Jenkins CI 的 jenkins pip 要求安装 psycopg2?

标签 python jenkins continuous-integration

对于 Jenkins 来说,我正在尝试使用本地 Jenkins 服务器来自动化我的测试,因为我对目录进行了更改,但是,当我尝试构建 virtualenv 以便我可以运行测试时,我收到以下错误我的代码库,它在 psycopg2 处中断,我不明白如何解决这个问题。 有没有更好的方法来构建我的 virtualenv 然后测试我的代码库?

Collecting psycopg2==2.6.1 (from -r requirements.txt (line 32))
  Downloading psycopg2-2.6.1.tar.gz (371kB)
    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'
    warning: manifest_maker: standard file '-c' not found

    Error: pg_config executable not found.

    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'.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l1/bwg91l0x1mn7dkjcw3bg569000007q/T/pip-build-TWCDOt/psycopg2
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Build step 'Virtualenv Builder' marked build as failure
Finished: FAILURE

下面是我的配置的图片,以帮助我设置 virtualenv。

enter image description here

最佳答案

您需要在您的机器上安装:

sudo apt-get install libpq-dev python-dev

关于python - 如何根据 Jenkins CI 的 jenkins pip 要求安装 psycopg2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35141438/

相关文章:

python - 如何为 Flask 中的所有请求运行操作?

python - Django form.is_valid() 未验证

Java TCP 服务器在客户端断开连接之前不接收数据包

jenkins - job-dsl - 如何在从 gitlab repo 分支创建作业时传递凭据?

Jenkins 管道: Check status of another project last build

windows - 从 AppVeyor 构建 Qt 项目

python - 用源代码在字符串中注释Python函数调用

ios - Jenkins 将 xcode 应用程序版本更新为 Hockeyapp

docker - gitlab ci如何将仓库复制回docker?

c# - 我如何以及为什么要设置 C# 构建机器?