I am trying to install the python package gensim
. I installed scipy
, smart_open
and numpy
, and ran pip install gensim
.
the installation failed in the preparing metadata
stage and a behemoth 954 lines of output were printed.
I'm not sure where is the actual error in it. cntl-f-ing for the word "error" brings
../numpy/core/src/npysort/binsearch.cpp(338): error C2131: expression did not evaluate to a constant
and right at the end there's this block of error-message-y looking text
"cl" "-Inumpy\core\_multiarray_umath.cp313-win_amd64.pyd.p" "-Inumpy\core" "-I..\numpy\core" "-Inumpy\core\include" "-I..\numpy\core\include" "-I..\numpy\core\src\common" "-I..\numpy\core\src\multiarray" "-I..\numpy\core\src\npymath" "-I..\numpy\core\src\umath" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.752.0_x64__qbz5n2kfra8p0\Include" "-IC:\Users\aviv\AppData\Local\Temp\pip-install-schzgq22\numpy_6bd4b901c9874883b7cd71c8defa1392\.mesonpy-helvat64\meson_cpu" "-DNDEBUG" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHsc" "/std:c++17" "/permissive-" "/O2" "/Gw" "-DNPY_HAVE_SSE2" "-DNPY_HAVE_SSE" "-DNPY_HAVE_SSE3" "-DNPY_INTERNAL_BUILD" "-DHAVE_NPY_CONFIG_H" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE=1" "-D_LARGEFILE64_SOURCE=1" "-D__STDC_VERSION__=0" "/Fdnumpy\core\_multiarray_umath.cp313-win_amd64.pyd.p\src_npysort_binsearch.cpp.pdb" /Fonumpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_npysort_binsearch.cpp.obj "/c" ../numpy/core/src/npysort/binsearch.cpp
../numpy/core/src/npysort/binsearch.cpp(338): error C2131: expression did not evaluate to a constant
../numpy/core/src/npysort/binsearch.cpp(309): note: failure was caused by a read of an uninitialized symbol
../numpy/core/src/npysort/binsearch.cpp(309): note: see usage of 'binsearch_base<noarg>::value_type::typenum'
../numpy/core/src/npysort/binsearch.cpp(395): note: see reference to class template instantiation 'binsearch_t<noarg>' being compiled
[369/503] Compiling C object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_multiarray_textreading_growth.c.obj
[370/503] Compiling C++ object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_npysort_timsort.cpp.obj
[371/503] Compiling C object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_npymath_arm64_exports.c.obj
[372/503] Compiling C object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_multiarray_textreading_stream_pyobject.c.obj
[373/503] Compiling C object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_multiarray_textreading_str_to_int.c.obj
[374/503] Compiling C object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_multiarray_textreading_rows.c.obj
[375/503] Compiling C++ object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_npysort_selection.cpp.obj
FAILED: numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_npysort_selection.cpp.obj
"cl" "-Inumpy\core\_multiarray_umath.cp313-win_amd64.pyd.p" "-Inumpy\core" "-I..\numpy\core" "-Inumpy\core\include" "-I..\numpy\core\include" "-I..\numpy\core\src\common" "-I..\numpy\core\src\multiarray" "-I..\numpy\core\src\npymath" "-I..\numpy\core\src\umath" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.752.0_x64__qbz5n2kfra8p0\Include" "-IC:\Users\aviv\AppData\Local\Temp\pip-install-schzgq22\numpy_6bd4b901c9874883b7cd71c8defa1392\.mesonpy-helvat64\meson_cpu" "-DNDEBUG" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHsc" "/std:c++17" "/permissive-" "/O2" "/Gw" "-DNPY_HAVE_SSE2" "-DNPY_HAVE_SSE" "-DNPY_HAVE_SSE3" "-DNPY_INTERNAL_BUILD" "-DHAVE_NPY_CONFIG_H" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE=1" "-D_LARGEFILE64_SOURCE=1" "-D__STDC_VERSION__=0" "/Fdnumpy\core\_multiarray_umath.cp313-win_amd64.pyd.p\src_npysort_selection.cpp.pdb" /Fonumpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_npysort_selection.cpp.obj "/c" ../numpy/core/src/npysort/selection.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ccomplex(22): warning C4996: '_Header_ccomplex': warning STL4004: <ccomplex>, <cstdalign>, <cstdbool>, and <ctgmath> are deprecated in C++17. You can define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
../numpy/core/src/npysort/selection.cpp(441): error C2131: expression did not evaluate to a constant
../numpy/core/src/npysort/selection.cpp(425): note: failure was caused by a read of an uninitialized symbol
../numpy/core/src/npysort/selection.cpp(425): note: see usage of 'arg_map::typenum'
[376/503] Compiling C++ object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_multiarray_textreading_tokenize.cpp.obj
[377/503] Compiling C++ object numpy/core/_multiarray_umath.cp313-win_amd64.pyd.p/src_npysort_quicksort.cpp.obj
ninja: build stopped: subcommand failed.
Activating VS 16.7.4
INFO: automatically activated MSVC compiler environment
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: C:\Users\aviv\AppData\Local\Temp\pip-build-env-o2e2ghvb\normal\Scripts\ninja.EXE
but this is complete gibberish to me.
I tried googling some of the lines but nothing came up. adding flags such as -U
or --upgrade
that i've seen used online didn't seem to help either.
I also encounted this answer about a similarly long pip error. but it's for a different package and on Mac so I doubt it's relevant.
frankly, I'm out of Ideas since I can't figure what the error even is.
From your error messages, you seem to be using Python 3.13. But the stable release of gensim (i.e. 4.3.3) currently has Python 3.8 - 3.12 wheels for all major platforms. There's no support yet for Python 3.13. You can downgrade to Python 3.12 to install this package.