Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install failure on homebrew Python 3.11 with clang error #3425

Open
alick opened this issue Jan 10, 2023 · 3 comments
Open

pip install failure on homebrew Python 3.11 with clang error #3425

alick opened this issue Jan 10, 2023 · 3 comments

Comments

@alick
Copy link

alick commented Jan 10, 2023

Problem description

Tried to install gensim on macOS with Python 3.11 from homebrew, but it failed due to compilation error.

pip3.11 install --upgrade gensim runs into

...
      copying gensim/models/word2vec_inner.pxd -> build/lib.macosx-12-arm64-cpython-311/gensim/models
      copying gensim/models/word2vec_inner.pyx -> build/lib.macosx-12-arm64-cpython-311/gensim/models
      copying gensim/corpora/_mmreader.c -> build/lib.macosx-12-arm64-cpython-311/gensim/corpora
      copying gensim/corpora/_mmreader.pyx -> build/lib.macosx-12-arm64-cpython-311/gensim/corpora
      running build_ext
      building 'gensim.models.word2vec_inner' extension
      creating build/temp.macosx-12-arm64-cpython-311
      creating build/temp.macosx-12-arm64-cpython-311/gensim
      creating build/temp.macosx-12-arm64-cpython-311/gensim/models
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/taoz/brew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I/Users/taoz/brew/lib/python3.11/site-packages/numpy/core/include -c gensim/models/word2vec_inner.c -o build/temp.macosx-12-arm64-cpython-311/gensim/models/word2vec_inner.o
      gensim/models/word2vec_inner.c:217:12: fatal error: 'longintrepr.h' file not found
        #include "longintrepr.h"
                 ^~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

Same issue reported at https://stackoverflow.com/q/74979674/1166587 by others.

Python 3.10 and pip3.10 install gensim: work.

Steps/code/corpus to reproduce

full tracebacks: https://gist.github.com/alick/d7a06116736cf36d4838572a1b8a1873

Versions

Please provide the output of:

In [3]: import platform; print(platform.platform())
   ...: import sys; print("Python", sys.version)
   ...: import struct; print("Bits", 8 * struct.calcsize("P"))
   ...: import numpy; print("NumPy", numpy.__version__)
   ...: import scipy; print("SciPy", scipy.__version__)
macOS-12.6.1-arm64-arm-64bit
Python 3.11.1 (main, Jan  7 2023, 20:18:46) [Clang 14.0.0 (clang-1400.0.29.202)]
Bits 64
NumPy 1.24.1
SciPy 1.10.0

macOS 12.6.1
Homebrew 3.6.17
pip 22.3.1

@gojomo
Copy link
Collaborator

gojomo commented Jan 10, 2023

I see other projects have hit similar with Python 3.11. It might be an issue requiring a cython upgrade before our .c files are compiled (if I'm reading aio-libs/aiohttp#6600 right) – perhaps to cython-0.29.25 or higher? Or, perhaps it's fixable with some extra CFLAGS under Python 3.11, if comment at termux/termux-packages#13327 (comment) applies – though conversation there also implies that maybe this header file shouldn't be referenced at all by external code?

@jc-louis
Copy link

Hello, any updates on this issue? Thanks!

@nikaro
Copy link
Contributor

nikaro commented Feb 20, 2023

It should be fixed by #3430. Waiting for a review/merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants