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

[Linux] Add Python 3.12 support #33

Open
TheEpic-dev opened this issue May 3, 2024 · 10 comments
Open

[Linux] Add Python 3.12 support #33

TheEpic-dev opened this issue May 3, 2024 · 10 comments

Comments

@TheEpic-dev
Copy link

Hey! I was trying to pip install piper-tts, but it fails to resolve piper-phonemize. I see on PyPI that there is a Python 3.12 build for Mac OS, but not for Linux. As Python 3.12 is now the default on Arch Linux and Ubuntu 24.04 LTS, would it be possible to update or rebuild the package with support for 3.12?

Thanks, Pat

@zetanor
Copy link

zetanor commented May 5, 2024

In the meantime, you can download the source from tag v1.1.0, and in it, edit the dockerfile to build a wheel for Python 3.12 (i.e., add to or replace the pip wheel calls to target cp312 rather than 311, 310...). The manylinux_2_28_x86_64 Docker image ships with CPython 3.12 so this is the only required change. Then you build per the readme file.

Then you install the whl you just built alongside with piper-tts. In pipx, you'd have to use something like --pip-args="$HOME/Temporary/piper-phonemize-1.1.0/dist/piper_phonemize-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl" (with an absolute path because pipx changes its working directory).

If you trust me—which you shouldn't since I could very well have added a system("rm -rf /home") or worse in there for kicks and giggles—here's my build: https://temp.zetanor.com/g417y32tss0q8l43bg4e6q/piper_phonemize-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl

@TheEpic-dev
Copy link
Author

In the meantime

Thanks. I decided it wasn't a high priority for me after all. I did want to test it locally real quick, but as I am already using Docker for a bunch of projects, I can easily run in an Ubuntu container with python 3.10.

@jhollowe
Copy link

jhollowe commented Jul 6, 2024

Would it be possible to upload the source bundle to pypi? That would allow pip to build the wheel locally (assuming the needed packages are installed) rather than just having to wait for built wheels be be pushed to pypi

@smallbraingames
Copy link

agreed

@sbussard
Copy link

sbussard commented Sep 3, 2024

Checking in on this -

It's September, how's it going?

@thewh1teagle
Copy link

thewh1teagle commented Sep 11, 2024

Does anyone interested working with me on that?

  1. Add option to build on Windows
  2. Add option to build on macOS
  3. Add BUILDING.md with docs about build it on linux/macos/windows
  4. Add CI on Github actions to build and publish pre built wheels for Windows/macOS.

Then we can create a PR here, and in the meantime a fork which will publish wheels.

@brandyn
Copy link

brandyn commented Dec 9, 2024

Any progress? Upgraded to the Ubuntu LTS release and my home lost its voice. :/

@thewh1teagle
Copy link

I created pypy project search on my github

@qt06
Copy link

qt06 commented Dec 11, 2024

Maybe you can use the follow command to install the piper-phonemizer:

pip install piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html

@brandyn
Copy link

brandyn commented Dec 13, 2024

I was able to get piper-tts installed on the latest Ubuntu LTS under python3.12 by (what I now realize is essentially @zetanor 's suggested method above) downloading an older version of the project from github and changing one line of the Dockerfile to compile a python 3.12 version. Here are the exact commands I issued in order (since it builds with docker, this should be fairly independent of your particular environ?). I did these as a regular user, not root. You will need to have docker-buildx installed and your user must be in the docker group:

  1. git clone https://github.com/rhasspy/piper-phonemize.git
    
  2. cd piper-phonemize
    
  3. git checkout 20554f24f807146fcf183f4a22ac10e9f24c9f45     # Last checkin with 1.1.0 tag?
    
  4. vi Dockerfile                                             # Add (it's obvious where): /opt/python/cp312-cp312/bin/pip wheel . && \
    
  5. docker buildx build . -t piper-phonemize --output 'type=local,dest=dist'
    
  6. cd dist
    
  7. pip install piper_phonemize-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
    
  8. pip install piper-tts
    

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

8 participants