1

尝试“pip install glpk”时出现以下错误,但出现一系列错误。这不像帖子 22135568,它实际上是用我正在使用的命令解决的。

错误如下所示:

In file included from src/lp.c:24:

src/kkt.h:30:3: error: unknown type name 'LPXKKT'

LPXKKT kkt;

^

src/lp.c:182:18: warning: implicit declaration of function 'lpx_read_model' is invalid in C99 [-Wimplicit-function-declaration]

    self->lp = lpx_read_model(model[0], model[1], model[2]);

             ^

src/lp.c:182:16: warning: incompatible integer to pointer conversion assigning to 'glp_prob *' (aka 'struct glp_prob *') from 'int' [-Wint-conversion]

    self->lp = lpx_read_model(model[0], model[1], model[2]);

           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/lp.c:338:7: warning: implicit declaration of function 'lpx_read_bas' is invalid in C99 [-Wimplicit-function-declaration]

if (lpx_read_bas(LP, bas_filename)) {

    ^

src/lp.c:349:8: error: use of undeclared identifier 'LPX_E_OK'

case LPX_E_OK:        Py_RETURN_NONE;

     ^

我试过自制软件,但这并没有安装 glpk。对于上下文,我使用的是 iPython 笔记本。

4

0 回答 0