gensim installation error on macs10.15.7 with 3.9.0

Viewed 1124

I tried to install gensim by pip install gensim but it fails with following pile of error on macs10.15.7 Catalina in python 3.9

      /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:649:25: error: no template named 'numeric_limits'
      return _FloatBigger ? numeric_limits<_IntT>::max() :  (numeric_limits<_IntT>::max() >> _Bits << _Bits);
                            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    220 warnings and 20 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: ~/.pyenv/versions/3.9.0/envs/jupyter/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pg/1drqvjn54tbczc1pl5qd8qwh0000gp/T/pip-install-ndvn1a9y/gensim_2b2eae30f7e140c0af90d98d9e598905/setup.py'"'"'; __file__='"'"'/private/var/folders/pg/1drqvjn54tbczc1pl5qd8qwh0000gp/T/pip-install-ndvn1a9y/gensim_2b2eae30f7e140c0af90d98d9e598905/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/pg/1drqvjn54tbczc1pl5qd8qwh0000gp/T/pip-record-_xbpvhdn/install-record.txt --single-version-externally-managed --compile --install-headers ~/.pyenv/versions/3.9.0/envs/jupyter/include/site/python3.9/gensim

I googled and could not find any solution for this. Could someone share some pointer

1 Answers

According to of of the main gensim pages it might not be ready for Python 3.9 yet.

"Gensim is being continuously tested under Python 3.5, 3.6, 3.7 and 3.8. Support for Python 2.7 was dropped in gensim 4.0.0 – install gensim 3.8.3 if you must use Python 2.7"

You can "downgrade" your Python version to 3.5/3.6/3.7 or 3.8 and it should work.

Related