YouTokenToMe icon indicating copy to clipboard operation
YouTokenToMe copied to clipboard

Fix install Cython errors on pip & poetry

Open gburlet opened this issue 2 years ago • 9 comments
trafficstars

Thanks for your work on this package but it seems it's falling behind in maintenance. It needs upgraded Cython as build dependency, and requires downgraded Python (3.9.16) in some cases. Relevant Issues:

  • https://github.com/MahmoudAshraf97/whisper-diarization/issues/33

This PR was created to address this issue, but remained stale because nobody with write permissions approved:

  • https://github.com/VKCOM/YouTokenToMe/pull/103

In fact, this PR is now too stale to be helpful. Here's another attempt to fix this library so it can actually be installed without downgrades, etc.

Instead of pinning Cython at a specific version I made a min version starting now.

gburlet avatar May 11 '23 19:05 gburlet

@borisshapa would you be able to take a look at this please?

gburlet avatar May 12 '23 18:05 gburlet

@gburlet, thanks for providing the fix.

I have implemented it in my fork of the project, leaving it here in case it can help someone who needs to install the library: https://github.com/LahiLuk/YouTokenToMe

LahiLuk avatar Aug 17 '23 14:08 LahiLuk

Can a mod please approve this so this library can be used by the community?

gburlet avatar Oct 02 '23 15:10 gburlet

Screenshot 2023-12-05 at 9 40 31 PM

Who has write access? Can someone ping them please?

gburlet avatar Dec 06 '23 04:12 gburlet

too bad this cant be merged but i found a way to install the fixed code with this command

pip install git+https://github.com/gburlet/YouTokenToMe.git@dependencies

eschmidbauer avatar Jan 02 '24 20:01 eschmidbauer

too bad this cant be merged but i found a way to install the fixed code with this command

pip install git+https://github.com/gburlet/YouTokenToMe.git@dependencies

thanks for the magic

WeileiZeng avatar Feb 27 '24 03:02 WeileiZeng

git+https://github.com/gburlet/YouTokenToMe.git@dependencies

Sad, but not working for poetry :( image


Updating dependencies
Resolving dependencies... (0.9s)

Package operations: 1 install, 0 updates, 0 removals

  - Installing youtokentome (1.0.6 e0fec1f): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel
  
  running bdist_wheel
  running build
  running build_py
  copying youtokentome/yttm_cli.py -> build/lib.linux-x86_64-cpython-310/youtokentome
  copying youtokentome/__init__.py -> build/lib.linux-x86_64-cpython-310/youtokentome
  copying youtokentome/youtokentome.py -> build/lib.linux-x86_64-cpython-310/youtokentome
  running build_ext
  building '_youtokentome_cython' extension
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Iyoutokentome/cpp -I/tmp/tmpej2ug4hp/.venv/include -I/usr/include/python3.10 -c youtokentome/cpp/bpe.cpp -o build/temp.linux-x86_64-cpython-310/youtokentome/cpp/bpe.o -std=c++11 -pthread -O3
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Iyoutokentome/cpp -I/tmp/tmpej2ug4hp/.venv/include -I/usr/include/python3.10 -c youtokentome/cpp/utf8.cpp -o build/temp.linux-x86_64-cpython-310/youtokentome/cpp/utf8.o -std=c++11 -pthread -O3
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Iyoutokentome/cpp -I/tmp/tmpej2ug4hp/.venv/include -I/usr/include/python3.10 -c youtokentome/cpp/utils.cpp -o build/temp.linux-x86_64-cpython-310/youtokentome/cpp/utils.o -std=c++11 -pthread -O3
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Iyoutokentome/cpp -I/tmp/tmpej2ug4hp/.venv/include -I/usr/include/python3.10 -c youtokentome/cpp/yttm.cpp -o build/temp.linux-x86_64-cpython-310/youtokentome/cpp/yttm.o -std=c++11 -pthread -O3
  youtokentome/cpp/yttm.cpp:43:10: fatal error: Python.h: No such file or directory
     43 | #include "Python.h"
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  

  at ~/.local/lib/python3.8/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
➜  model-delivery git:(feature/code) ✗ 

Anna-Pinewood avatar Mar 06 '24 13:03 Anna-Pinewood

@Anna-Pinewood I had the same issue and fixed it by running sudo apt-get install python3.11-dev, which in your case might be sudo apt-get install python-dev. Seems like that's a missing dependency triggering the python.h missing file error.

parithosh avatar Mar 23 '24 21:03 parithosh

@parithosh , thank you for the tip! I use python 3.10. Firstly, i tried sudo apt-get install python-dev, python-dev was installed, then i tried to get youtokentome – didn't work. However, when i did

poetry add git+https://github.com/gburlet/YouTokenToMe.git@dependencies

It did! image

Anna-Pinewood avatar Mar 26 '24 17:03 Anna-Pinewood