jmschrei / pomegranate

Fast, flexible and easy to use probabilistic modelling in Python.
http://pomegranate.readthedocs.org/en/latest/
MIT License
3.29k stars 591 forks source link

[BUG] Pomegranate can not be pip installed on Python 3.11 #1009

Closed hylkedonker closed 1 year ago

hylkedonker commented 1 year ago

Description When I try to pip install pomegranate on Python 3.11, it starts building wheels and eventually terminates with the following error:

      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -I/tmp/pip-build-env-9ivz0_ud/overlay/lib/python3.11/site-packages/numpy/core/include -c pomegranate/MarkovChain.c -o build/temp.linux-x86_64-cpython-311/pomegranate/MarkovChain.o
      pomegranate/MarkovChain.c:208:12: fatal error: longintrepr.h: No such file or directory
        208 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pomegranate
Failed to build pomegranate
ERROR: Could not build wheels for pomegranate, which is required to install pyproject.toml-based projects

This error might be related to Cython, looking at this Cython pull request.

To Reproduce

docker run python:3.11 pip3 install pomegranate
nigel-daniels commented 1 year ago

I'm also seeing this error, my Python version is 0.29.33

nigel-daniels commented 1 year ago

I'm also seeing this error, my Python version is 0.29.33

Apologies, auto correct... Cython version is 0.29.33

ShineQi commented 1 year ago

Same error on windows python 3.11 when using pip install

      building 'pomegranate.MarkovChain' extension
      "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Python311\include -IC:\Python311\Include -IC:\Users\cnxiqi4\AppData\Local\Temp\pip-build-env-d2dwy25b\overlay\Lib\site-packages\numpy\core\include "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcpomegranate\MarkovChain.c /Fobuild\temp.win-amd64-cpython-311\Release\pomegranate\MarkovChain.obj
      MarkovChain.c
      pomegranate\MarkovChain.c(208): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pomegranate
Failed to build pomegranate
ERROR: Could not build wheels for pomegranate, which is required to install pyproject.toml-based projects

Installed with command: python setup.py install after clone the master branch

jmschrei commented 1 year ago

Thank you for opening an issue. pomegranate has recently been rewritten from the ground up to use PyTorch instead of Cython (v1.0.0), and so all issues are being closed as they are likely out of date. Please re-open or start a new issue if a related issue is still present in the new codebase.