YouTokenToMe
YouTokenToMe copied to clipboard
Fix install Cython errors on pip & poetry
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.
@borisshapa would you be able to take a look at this please?
@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
Can a mod please approve this so this library can be used by the community?
Who has write access? Can someone ping them please?
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
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
git+https://github.com/gburlet/YouTokenToMe.git@dependencies
Sad, but not working for poetry :(
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 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 , 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!