今天安装gensim一直失败,网上找了各种办法都不得,换了各种python版本,虚拟环境都创建了好几次
numy、scipy都装了也无济于事,正准备放弃时,仔细看了错误信息的后几行
gensim/models/nmf_pgd.c: In function ‘__Pyx_InitGlobals’: ? ? gensim/models/nmf_pgd.c:16518:1: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations] ? ? ?PyEval_InitThreads(); ? ? ?^~~~~~~~~~~~~~~~~~ ? ? In file included from /usr/local/python3/include/python3.9/Python.h:154, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/ceval.h:130:37: note: declared here ? ? ?Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c: In function ‘__Pyx_ParseOptionalKeywords’: ? ? gensim/models/nmf_pgd.c:17188:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17188:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here ? ? ?Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17188:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17188:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17188:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here ? ? ?Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17188:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17204:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17204:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here ? ? ?Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17204:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17204:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17204:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here ? ? ?Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c:17204:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here ? ? ?static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~~~~~~ ? ? gensim/models/nmf_pgd.c: In function ‘__Pyx_decode_c_string’: ? ? gensim/models/nmf_pgd.c:18132:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations] ? ? ? ? ? ? ?return PyUnicode_FromUnicode(NULL, 0); ? ? ? ? ? ? ?^~~~~~ ? ? In file included from /usr/local/python3/include/python3.9/unicodeobject.h:1026, ? ? ? ? ? ? ? ? ? ? ?from /usr/local/python3/include/python3.9/Python.h:106, ? ? ? ? ? ? ? ? ? ? ?from gensim/models/nmf_pgd.c:18: ? ? /usr/local/python3/include/python3.9/cpython/unicodeobject.h:551:42: note: declared here ? ? ?Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^~~~~~~~~~~~~~~~~~~~~ ? ? gcc -pthread -shared build/temp.linux-x86_64-3.9/gensim/models/nmf_pgd.o -o build/lib.linux-x86_64-3.9/gensim/models/nmf_pgd.cpython-39-x86_64-linux-gnu.so ? ? building 'gensim.models.doc2vec_inner' extension ? ? gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/python3/include/python3.9 -I/usr/local/python3/lib/python3.9/site-packages/numpy/core/include -c gensim/models/doc2vec_inner.cpp -o build/temp.linux-x86_64-3.9/gensim/models/doc2vec_inner.o -std=c++11 ? ? gcc: error trying to exec 'cc1plus': execvp: No such file or directory ? ? error: command '/bin/gcc' failed with exit code 1 ? ? ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/local/python3/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yole547i/gensim_ae8bbb5463c2490b90bb2f166395f231/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yole547i/gensim_ae8bbb5463c2490b90bb2f166395f231/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-6bbjeqt2/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/python3/include/python3.9/gensim Check the logs for full command output. 原来是缺少gcc-c++编译器,于是安装yum install gcc-c++
然后进行gensim安装马上成功了
|