CentOS安装gensim出现ERROR: Command errored out with exit status 1:
最近在使用安装gensim包时出现下面的问题:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting gensim
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/24/97/2197f018ee9f8ce2f071b2d9c6711c76159aead710f8d24a2bf006082a28/gensim-4.2.0.tar.gz (23.2 MB)
Requirement already satisfied: numpy>=1.17.0 in /home/***/anaconda3/envs/***/lib/python3.6/site-packages (from gensim) (1.19.5)
Requirement already satisfied: scipy>=0.18.1 in /home/***/anaconda3/envs***/lib/python3.6/site-packages (from gensim) (1.5.4)
Requirement already satisfied: smart_open>=1.8.1 in /home/***/anaconda3/envs/***/lib/python3.6/site-packages (from gensim) (6.2.0)
Building wheels for collected packages: gensim
Building wheel for gensim (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/***/anaconda3/envs/***/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gfccadf1/gensim_da932b459cde4dd98dadfb32c9c9b2a2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gfccadf1/gensim_da932b459cde4dd98dadfb32c9c9b2a2/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'"'"'))' bdist_wheel -d /tmp/pip-wheel-5zhb6n_2
cwd: /tmp/pip-install-gfccadf1/gensim_da932b459cde4dd98dadfb32c9c9b2a2/
Complete output (464 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/gensim
copying gensim/__init__.py -> build/lib.linux-x86_64-3.6/gensim
copying gensim/downloader.py -> build/lib.linux-x86_64-3.6/gensim
copying gensim/interfaces.py -> build/lib.linux-x86_64-3.6/gensim
中间省略非常非常长的一段
----------------------------------------
ERROR: Command errored out with exit status 1: /home/***/anaconda3/envs***/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gfccadf1/gensim_da932b459cde4dd98dadfb32c9c9b2a2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gfccadf1/gensim_da932b459cde4dd98dadfb32c9c9b2a2/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-yb04cdrt/install-record.txt --single-version-externally-managed --compile --install-headers /home/***/anaconda3/envs/***/include/python3.6m/gensim Check the logs for full command output.
试了无数种网上查到的方法后还是不行,尝试过安装c++环境等方法,都没有用,最后使用
conda install gensim
显示安装成功,安装成功后可以再使用
pip install gebsim=3.4
进行指定版本更新。