pip安装gensim失败:scipy元数据生成错误求助
安装Gensim时Scipy元数据生成失败求助
我尝试安装Gensim用于主题建模,但始终卡在Scipy的元数据生成环节,无法完成安装。执行pip install gensim时的错误信息如下:
Collecting gensim Using cached gensim-4.3.3.tar.gz (23.3 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting numpy<2.0,>=1.18.5 (from gensim) Using cached numpy-1.26.4.tar.gz (15.8 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting scipy<1.14.0,>=1.7.0 (from gensim) Using cached scipy-1.13.1.tar.gz (57.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [47 lines of output] + meson setup C:\Users\chris\AppData\Local\Temp\pip-install-w3xvcmvu\scipy_eadead623c7d42e18d122f751d3d943b C:\Users\chris\AppData\Local\Temp\pip-install-w3xvcmvu\scipy_eadead623c7d42e18d122f751d3d943b\.mesonpy-sycykl_n -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\chris\AppData\Local\Temp\pip-install-w3xvcmvu\scipy_eadead623c7d42e18d122f751d3d943b\.mesonpy-sycykl_n\meson-python-native-file.ini The Meson build system Version: 1.8.3 Source dir: C:\Users\chris\AppData\Local\Temp\pip-install-w3xvcmvu\scipy_eadead623c7d42e18d122f751d3d943b Build dir: C:\Users\chris\AppData\Local\Temp\pip-install-w3xvcmvu\scipy_eadead623c7d42e18d122f751d3d943b\.mesonpy-sycykl_n Build type: native build Activating VS 17.14.10 Project name: scipy Project version: 1.13.1 C compiler for the host machine: cl (msvc 19.44.35213 "Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35213 for x64") C linker for the host machine: link link 14.44.35213.0 C++ compiler for the host machine: cl (msvc 19.44.35213 "Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35213 for x64") C++ linker for the host machine: link link 14.44.35213.0 Cython compiler for the host machine: cython (cython 3.0.12) Host machine cpu family: x86_64 Host machine cpu: x86_64 Program python found: YES (C:\Users\chris\anaconda3\python.exe) Run-time dependency python found: YES 3.13 Program cython found: YES (C:\Users\chris\AppData\Local\Temp\pip-build-env-yrm26wax\overlay\Scripts\cython.EXE) Compiler for C supports arguments -Wno-unused-but-set-variable: NO Compiler for C supports arguments -Wno-unused-function: NO Compiler for C supports arguments -Wno-conversion: NO Compiler for C supports arguments -Wno-misleading-indentation: NO Library m found: NO ..\meson.build:78:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang-new'], ['flang'], ['pgfortran'], ['g95']] The following exception(s) were encountered: Running `ifort --help` gave "[WinError 2] 系统找不到指定的文件。" Running `ifort --version` gave "[WinError 2] 系统找不到指定的文件。" Running `ifort -V` gave "[WinError 2] 系统找不到指定的文件。" Running `gfortran --help` gave "[WinError 2] 系统找不到指定的文件。" Running `gfortran --version` gave "[WinError 2] 系统找不到指定的文件。" Running `gfortran -V` gave "[WinError 2] 系统找不到指定的文件。" Running `flang-new --help` gave "[WinError 2] 系统找不到指定的文件。" Running `flang-new --version` gave "[WinError 2] 系统找不到指定的文件。" Running `flang-new -V` gave "[WinError 2] 系统找不到指定的文件。" Running `flang --help` gave "[WinError 2] 系统找不到指定的文件。" Running `flang --version` gave "[WinError 2] 系统找不到指定的文件。" Running `flang -V` gave "[WinError 2] 系统找不到指定的文件。" Running `pgfortran --help` gave "[WinError 2] 系统找不到指定的文件。" Running `pgfortran --version` gave "[WinError 2] 系统找不到指定的文件。" Running `pgfortran -V` gave "[WinError 2] 系统找不到指定的文件。" Running `g95 --help` gave "[WinError 2] 系统找不到指定的文件。" Running `g95 --version` gave "[WinError 2] 系统找不到指定的文件。" Running `g95 -V` gave "[WinError 2] 系统找不到指定的文件。" A full log can be found at C:\Users\chris\AppData\Local\Temp\pip-install-w3xvcmvu\scipy_eadead623c7d42e18d122f751d3d943b\.mesonpy-sycykl_n\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
我已经尝试过以下方法,但都没能解决问题:
- 安装了包含桌面开发C++组件的Visual Studio
- 尝试调整Scipy与Python的版本组合,未成功
- 执行
conda install gensim时出现Python版本不兼容错误 - 完全卸载Python后重新安装Anaconda
内容的提问来源于stack exchange,提问作者Choptdei
相关产品推荐
相关产品推荐

