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

Error installing on Linux #6

Open
rohan2810 opened this issue Jan 31, 2025 · 1 comment
Open

Error installing on Linux #6

rohan2810 opened this issue Jan 31, 2025 · 1 comment

Comments

@rohan2810
Copy link

Got this error using pip install krovetzstemmer. I even tried cloning the repo and then pip install .
Still the same issue.

Collecting krovetzstemmer
  Using cached KrovetzStemmer-0.8.tar.gz (112 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: krovetzstemmer
  Building wheel for krovetzstemmer (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      In file included from /usr/include/string.h:535,
                       from /usr/include/c++/11/cstring:42,
                       from KrovetzStemmer.hpp:18,
                       from KrovetzStemmer.cpp:39:
      In function ‘char* strncpy(char*, const char*, size_t)’,
          inlined from ‘int stem::KrovetzStemmer::kstem_stem_tobuffer(char*, char*)’ at KrovetzStemmer.cpp:1022:5:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 12 equals destination size [-Wstringop-truncation]
         95 |   return __builtin___strncpy_chk (__dest, __src, __len,
            |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
         96 |                                   __glibc_objsize (__dest));
            |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
      krovetzstemmer_module.cpp:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-g++' 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 krovetzstemmer
  Running setup.py clean for krovetzstemmer
Failed to build krovetzstemmer
ERROR: Failed to build installable wheels for some pyproject.toml based projects (krovetzstemmer)
@rueycheng
Copy link
Member

Seems like you missed some python dev headers. What distribution is this? If it's debian/ubuntu you can just do the following to fix the problem

sudo apt-get install python3-dev

Take a look at this StackOverflow question for context.

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

2 participants