簡體   English   中英

Oursql 安裝:錯誤:命令“x86_64-linux-gnu-gcc”失敗,退出狀態為 1

[英]Oursql install : error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我已經經歷了大部分以前的錯誤並且已經安裝在 python 3.5 virtualenv 中:python3-dev libmysqlclient-dev libmariadb-client-lgpl-dev libmariadb-client-lgpl-dev-compat

但是

sudo pip 安裝我們的sql

仍然得到這個錯誤:

Installing collected packages: oursql
  Running setup.py install for oursql ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-

build-fHedbn/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r

\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-V5ljoT-record/install-record.txt --single-

version-externally-managed --compile:
    cython not found, using previously-cython'd .c file.
    running install
    running build
    running build_ext
    building 'oursql' extension
    mysql_config --cflags
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/oursqlx
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing 

-Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -

I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o -

I/usr/include/mysql -fabi-version=2 -fno-omit-frame-pointer
    In file included from /usr/include/mysql/mysql.h:64:0,
                     from oursqlx/compat.h:13,
                     from oursqlx/oursql.c:235:
    /usr/include/mysql/mysql/client_plugin.h:97:3: warning: function declaration isn’t a prototype [-

Wstrict-prototypes]
       MYSQL_CLIENT_PLUGIN_HEADER
       ^
    In file included from /usr/include/mysql/mysql.h:64:0,
                     from oursqlx/compat.h:13,
                     from oursqlx/oursql.c:235:
    /usr/include/mysql/mysql/client_plugin.h:107:3: warning: function declaration isn’t a prototype [-

Wstrict-prototypes]
       MYSQL_CLIENT_PLUGIN_HEADER
       ^
    oursqlx/oursql.c: In function ‘__pyx_pf_6oursql_6Cursor_4callproc’:
    oursqlx/oursql.c:16330:13: warning: variable ‘__pyx_v_params’ set but not used [-Wunused-but-set-

variable]
       PyObject *__pyx_v_params = 0;
                 ^
    oursqlx/oursql.c:16329:13: warning: variable ‘__pyx_v_procname’ set but not used [-Wunused-but-set-

variable]
       PyObject *__pyx_v_procname = 0;
                 ^
    oursqlx/oursql.c: In function ‘__pyx_pf_6oursql_6Cursor_14setoutputsize’:
    oursqlx/oursql.c:18140:13: warning: variable ‘__pyx_v_column’ set but not used [-Wunused-but-set-

variable]
       PyObject *__pyx_v_column = 0;
                 ^
    oursqlx/oursql.c:18139:13: warning: variable ‘__pyx_v_size’ set but not used [-Wunused-but-set-

variable]
       PyObject *__pyx_v_size = 0;
                 ^
    oursqlx/oursql.c: In function ‘__pyx_pf_6oursql_6Cursor_16__exit__’:
    oursqlx/oursql.c:18245:13: warning: variable ‘__pyx_v_tb’ set but not used [-Wunused-but-set-variable]
       PyObject *__pyx_v_tb = 0;
                 ^
    oursqlx/oursql.c:18244:13: warning: variable ‘__pyx_v_value’ set but not used [-Wunused-but-set-

variable]
       PyObject *__pyx_v_value = 0;
                 ^
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing 

-Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -

I/usr/include/python2.7 -c oursqlx/compat.c -o build/temp.linux-x86_64-2.7/oursqlx/compat.o -

I/usr/include/mysql -fabi-version=2 -fno-omit-frame-pointer
    In file included from /usr/include/mysql/mysql.h:64:0,
                     from oursqlx/compat.h:13,
                     from oursqlx/compat.c:1:
    /usr/include/mysql/mysql/client_plugin.h:97:3: warning: function declaration isn’t a prototype [-

Wstrict-prototypes]
       MYSQL_CLIENT_PLUGIN_HEADER
       ^
    In file included from /usr/include/mysql/mysql.h:64:0,
                     from oursqlx/compat.h:13,
                     from oursqlx/compat.c:1:
    /usr/include/mysql/mysql/client_plugin.h:107:3: warning: function declaration isn’t a prototype [-

Wstrict-prototypes]
       MYSQL_CLIENT_PLUGIN_HEADER
       ^
    In file included from oursqlx/compat.c:55:0:
    oursqlx/_exceptions.c: In function ‘_oursqlx_exc_from_errno’:
    oursqlx/_exceptions.c:620:24: error: ‘ER_ERROR_FIRST’ undeclared (first use in this function)
                 if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST)
                            ^
    oursqlx/_exceptions.c:620:24: note: each undeclared identifier is reported only once for each function 

it appears in
    oursqlx/_exceptions.c:620:49: error: ‘ER_ERROR_LAST’ undeclared (first use in this function)
                 if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST)
                                                     ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-

fHedbn/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', 

'\n'), __file__, 'exec'))" install --record /tmp/pip-V5ljoT-record/install-record.txt --single-version-

externally-managed --compile" failed with error code 1 in /tmp/pip-build-fHedbn/oursql/

非常感謝任何幫助!

這可能是由於對 MySQL 5.7 的更新。 一些常量被刪除,這破壞了oursql構建。 在 oursql 中查看此拉取請求

升級到oursql >= 0.9.3.2應該可以解決這個問題。

請注意,這個0.9.3.2無法使用 MariaDB 10 構建。 在那里你必須使用0.9.3.1

通常,該錯誤消息意味着在主機級別缺少軟件包。

基於: 錯誤:安裝腳本退出錯誤:命令'x86_64-linux-gnu-gcc'失敗,退出狀態為1

嘗試:

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

最近,轉向 pymysql 效果很好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM