Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Fix install Cython errors on pip & poetry #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gburlet
Copy link

@gburlet gburlet commented May 11, 2023

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:

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

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 gburlet changed the title Fix install Cython errors on poetry Fix install Cython errors on pip & poetry May 11, 2023
@gburlet
Copy link
Author

gburlet commented May 12, 2023

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

@LahiLuk
Copy link

LahiLuk commented Aug 17, 2023

@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

Copy link

@hidenori-endo hidenori-endo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixed the problem for me, thanks.
And seems better to be merged

@gburlet
Copy link
Author

gburlet commented Oct 2, 2023

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

@gburlet
Copy link
Author

gburlet commented Dec 6, 2023

Screenshot 2023-12-05 at 9 40 31 PM

Who has write access? Can someone ping them please?

@eschmidbauer
Copy link

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

Copy link

@simcop2387 simcop2387 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes things for PEP 518

@WeileiZeng
Copy link

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

@Anna-Pinewood
Copy link

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) ✗ 

@parithosh
Copy link

@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.

@Anna-Pinewood
Copy link

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.