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

Could not build wheels for datrie -- using MacOS Monterey (12.6) #97

Open
bagotaj opened this issue Oct 8, 2022 · 10 comments
Open

Could not build wheels for datrie -- using MacOS Monterey (12.6) #97

bagotaj opened this issue Oct 8, 2022 · 10 comments

Comments

@bagotaj
Copy link

bagotaj commented Oct 8, 2022

Hey guys, pip install datrie failed
because src/datrie.c:26:10: fatal error: 'Python.h' file not found

the full output:

running bdist_wheel
      running build
      running build_clib
      building 'datrie' library
      libdatrie/datrie/alpha-map.c:500:21: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'AlphaChar' (aka 'unsigned int') [-Wsign-compare]
          if (alpha_begin <= ac && ac <= alpha_map->alpha_end)
              ~~~~~~~~~~~ ^  ~~
      1 warning generated.
      libdatrie/datrie/alpha-map.c:500:21: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'AlphaChar' (aka 'unsigned int') [-Wsign-compare]
          if (alpha_begin <= ac && ac <= alpha_map->alpha_end)
              ~~~~~~~~~~~ ^  ~~
      1 warning generated.
      libdatrie/datrie/darray.c:239:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (d->num_cells > SIZE_MAX / sizeof (DACell))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      libdatrie/datrie/darray.c:239:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (d->num_cells > SIZE_MAX / sizeof (DACell))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      libdatrie/datrie/fileutils.c:103:52: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fread (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      libdatrie/datrie/fileutils.c:109:53: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fwrite (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      2 warnings generated.
      libdatrie/datrie/fileutils.c:103:52: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fread (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      libdatrie/datrie/fileutils.c:109:53: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fwrite (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      2 warnings generated.
      libdatrie/datrie/tail.c:144:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (t->num_tails > SIZE_MAX / sizeof (TailBlock))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      libdatrie/datrie/tail.c:144:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (t->num_tails > SIZE_MAX / sizeof (TailBlock))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: archive library: build/temp.macosx-10.9-universal2-cpython-39/libdatrie.a will be fat and ar(1) will not be able to operate on it
      running build_ext
      building 'datrie' extension
      src/datrie.c:26:10: fatal error: 'Python.h' file not found
      #include "Python.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: Failed building wheel for datrie
Failed to build datrie
ERROR: Could not build wheels for datrie, which is required to install pyproject.toml-based projects
(rhymedict-multisite) jbagota@Bagotas-MBP rhymedict-multisite % pip install datrie
Collecting datrie
  Using cached datrie-0.8.2.tar.gz (63 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: datrie
  Building wheel for datrie (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for datrie (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      running bdist_wheel
      running build
      running build_clib
      building 'datrie' library
      libdatrie/datrie/alpha-map.c:500:21: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'AlphaChar' (aka 'unsigned int') [-Wsign-compare]
          if (alpha_begin <= ac && ac <= alpha_map->alpha_end)
              ~~~~~~~~~~~ ^  ~~
      1 warning generated.
      libdatrie/datrie/alpha-map.c:500:21: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'AlphaChar' (aka 'unsigned int') [-Wsign-compare]
          if (alpha_begin <= ac && ac <= alpha_map->alpha_end)
              ~~~~~~~~~~~ ^  ~~
      1 warning generated.
      libdatrie/datrie/darray.c:239:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (d->num_cells > SIZE_MAX / sizeof (DACell))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      libdatrie/datrie/darray.c:239:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (d->num_cells > SIZE_MAX / sizeof (DACell))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      libdatrie/datrie/fileutils.c:103:52: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fread (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      libdatrie/datrie/fileutils.c:109:53: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fwrite (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      2 warnings generated.
      libdatrie/datrie/fileutils.c:103:52: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fread (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      libdatrie/datrie/fileutils.c:109:53: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
          return (fwrite (buff, sizeof (char), len, file) == len);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
      2 warnings generated.
      libdatrie/datrie/tail.c:144:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (t->num_tails > SIZE_MAX / sizeof (TailBlock))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      libdatrie/datrie/tail.c:144:22: warning: comparison of integers of different signs: 'TrieIndex' (aka 'int') and 'unsigned long' [-Wsign-compare]
          if (t->num_tails > SIZE_MAX / sizeof (TailBlock))
              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: archive library: build/temp.macosx-10.9-universal2-cpython-39/libdatrie.a will be fat and ar(1) will not be able to operate on it
      running build_ext
      building 'datrie' extension
      src/datrie.c:26:10: fatal error: 'Python.h' file not found
      #include "Python.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: Failed building wheel for datrie
Failed to build datrie
ERROR: Could not build wheels for datrie, which is required to install pyproject.toml-based projects
@svenvanderburg
Copy link

I report the same issue. In fact, multiple students in my classroom with different operating systems (mac os, windows, windows) have it.

@bricoletc
Copy link

I had the same issue on my Ubuntu machine - clang is trying to pull in "Python.h", a header file used to build python extensions. In my case I ran apt install python3-dev to obtain the header and it all worked. More info here :-)

@LaniakeaS
Copy link

any updates?

@janluke
Copy link

janluke commented May 24, 2024

Same issue on Ubuntu with Python 3.10. With Python 3.8 it worked.

@janluke
Copy link

janluke commented May 24, 2024

It's simply due to the fact the author doesn't build and push wheels for python > 3.8: https://pypi.org/project/datrie/#files

@Tianqi-Ma
Copy link

It's simply due to the fact the author doesn't build and push wheels for python > 3.8: https://pypi.org/project/datrie/#files

Are there any solutions for 3.10?

@Tianqi-Ma
Copy link

It's simply due to the fact the author doesn't build and push wheels for python > 3.8: https://pypi.org/project/datrie/#files

Are there any solutions for 3.10?

I found a solution: just download whl file and change its name to the version of your python. For example, I download "datrie-0.8.2-pp373-pypy36_pp73-win32.whl" and change it to "datrie-0.8.2-cp310-none-any.whl". Then running " pip install ......\Downloads\datrie-0.8.2-cp310-none-any.whl".

@chuan-mt
Copy link

pip install -r dev-requirements.txt
pip install datrie
install dev-requirements.txt depends can solve this problem
https://github.com/pytries/datrie/blob/master/dev-requirements.txt

cython
hypothesis
pytest

@Nicolascanala
Copy link

Nicolascanala commented Oct 10, 2024

Any solutions? I'm running python 3.12.7. Getting the same issue on Ubuntu.

@manzt
Copy link

manzt commented Nov 20, 2024

Ran into a similar issue: no wheel for macOS ARM (python 3.13), and the build failed due to a missing llvm-ar. It seems the build process doesn't check the system PATH for llvm-ar. To fix, I was able to explicitly set the AR environment variable when installing.

For example, with uv:

AR=/opt/homebrew/opt/llvm/bin/llvm-ar uvx --with=datrie ipython
# Installed 17 packages in 63ms
# Python 3.13.0 (main, Oct 16 2024, 08:05:40) [Clang 18.1.8 ]
# Type 'copyright', 'credits' or 'license' for more information
# IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.
# 
# [ins] In [1]: import datrie

or with pip:

AR=/opt/homebrew/opt/llvm/bin/llvm-ar pip install datrie

I had to brew install llvm as well. Hopefully that helps others.

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

9 participants