lukeparser / pybison

Use Bison directly from Python
https://pypi.org/project/pybison
GNU General Public License v2.0
26 stars 6 forks source link

Can't install pybison through pip #44

Open DrovakSobral opened 3 days ago

DrovakSobral commented 3 days ago

When I try to install pybison through pip using

pip install pybison

It returns the following error

Collecting pybison
  Using cached pybison-0.6.3.tar.gz (35 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting six (from pybison)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting setuptools (from pybison)
  Using cached setuptools-75.3.0-py3-none-any.whl.metadata (6.9 kB)
Using cached setuptools-75.3.0-py3-none-any.whl (1.3 MB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: pybison
  Building wheel for pybison (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pybison (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [47 lines of output]
      Cython does not appear to be installed. Attempting to use pre-made cpp file...
      running bdist_wheel
      C:\Users\joaom\AppData\Local\Temp\pip-build-env-kfdh2mnj\overlay\Lib\site-packages\setuptools\_distutils\cmd.py:111: SetuptoolsDeprecationWarning: bdist_wheel.universal is deprecated
      !!

              ********************************************************************************
              With Python 2.7 end-of-life, support for building universal wheels
              (i.e., wheels that support both Python 2 and Python 3)
              is being obviated.
              Please discontinue using this option, or if you still need it,
              file an issue with pypa/setuptools describing your use case.

              By 2025-Aug-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
              ********************************************************************************

      !!
        self.finalize_options()
      running build
      running build_py
      creating build\lib.win-amd64-cpython-312\bison
      copying src\bison\convert.py -> build\lib.win-amd64-cpython-312\bison
      copying src\bison\node.py -> build\lib.win-amd64-cpython-312\bison
      copying src\bison\xmlifier.py -> build\lib.win-amd64-cpython-312\bison
      copying src\bison\__init__.py -> build\lib.win-amd64-cpython-312\bison
      creating build\lib.win-amd64-cpython-312\bison\c
      copying src\bison\c\bison_callback.c -> build\lib.win-amd64-cpython-312\bison\c
      copying src\bison\c\bison_callback.h -> build\lib.win-amd64-cpython-312\bison\c
      copying src\bison\c\bisondynlib.h -> build\lib.win-amd64-cpython-312\bison\c
      copying src\bison\c\bisondynlib-linux.c -> build\lib.win-amd64-cpython-312\bison\c
      copying src\bison\c\bisondynlib-win32.c -> build\lib.win-amd64-cpython-312\bison\c
      creating build\lib.win-amd64-cpython-312\bison\cython
      copying src\bison\cython\bison_.pyx -> build\lib.win-amd64-cpython-312\bison\cython
      running build_ext
      building 'bison.bison_' extension
      creating build\temp.win-amd64-cpython-312\Release\src\bison\c
      creating build\temp.win-amd64-cpython-312\Release\src\bison\cython
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-Ic:\Users\joaom\Desktop\pybison teste\.venv\include" -IC:\Users\joaom\AppData\Local\Programs\Python\Python312\include -IC:\Users\joaom\AppData\Local\Programs\Python\Python312\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc\bison\c\bison_callback.c /Fobuild\temp.win-amd64-cpython-312\Release\src\bison\c\bison_callback.obj -D__builtin_expect(a,b)=(a)
      bison_callback.c
      src\bison\c\bison_callback.c(155): warning C4047: 'return': 'PyObject *' difere em n¡veis de indire‡Æo de 'int'
      src\bison\c\bison_callback.c(245): warning C4267: '=': conversÆo de 'size_t' para 'int', poss¡vel perda de dados
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-Ic:\Users\joaom\Desktop\pybison teste\.venv\include" -IC:\Users\joaom\AppData\Local\Programs\Python\Python312\include -IC:\Users\joaom\AppData\Local\Programs\Python\Python312\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc\bison\c\bisondynlib-win32.c /Fobuild\temp.win-amd64-cpython-312\Release\src\bison\c\bisondynlib-win32.obj -D__builtin_expect(a,b)=(a)
      bisondynlib-win32.c
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-Ic:\Users\joaom\Desktop\pybison teste\.venv\include" -IC:\Users\joaom\AppData\Local\Programs\Python\Python312\include -IC:\Users\joaom\AppData\Local\Programs\Python\Python312\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc\bison\cython\bison_.c /Fobuild\temp.win-amd64-cpython-312\Release\src\bison\cython\bison_.obj -D__builtin_expect(a,b)=(a)
      bison_.c
      c1: fatal error C1083: NÆo ‚ poss¡vel abrir arquivo fonte: 'src\bison\cython\bison_.c': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\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 pybison
Failed to build pybison
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pybison)
sbrodehl commented 3 days ago

Hi there!

Thanks for bringing this up! We are currently having issues with publishing new packages to pypi, that's the reason we don't have prebuild packages for python 3.12 and higher on there.

I will start fixing this issue and provide newer prebuild packages on pypi.

In the meantime you can use python 3.11 and install one of the packages from pypi.org, or install Cython to compile the missing c file in your python 3.12 environment yourself.

Let me know how this turns out!

Edit: Can you let me know what platform you are installing the package on? E.g. pasting the output of python3 -c "import platform; print(platform.uname());".

sbrodehl commented 2 days ago

Good news!

We just published version 0.6.4 to pypi! Just run pip install pybison again and it should use the newly published builds.