0 votes

I noticed that PTXprint is distributed on Ubuntu 25.04 under the package name python3-ptxprint (Edit: this is incorrect, Ubuntu's repositories do not include PTXprint. I must have installed python3-ptxprint from another source). This makes me think that ptxprint is a Python module, that could be found on PyPI, but I can't find it.

If I run pip install ptxprint , I get this error:

ERROR: Could not find a version that satisfies the requirement ptxprint (from versions: none)
ERROR: No matching distribution found for ptxprint

Likewise, the link https://pypi.org/project/ptxprint/ leads to a 404 error.

Is ptxprint available as a Python package? It would be handy to be able to run ptxprint headlessly, and to include it as a dependency in my Python application.

PTXprint by (495 points)
edited by

2 Answers

0 votes
Best answer

PTXprint is not available on PyPI. My guess is that the developers chose not to publish the package on PyPI, because the package has a lot of dependencies that themselves aren't on PyPI (like GTK and TeX Live). So, even if the package was available on PyPI, installation would still be more complicated than just running pip install ptxprint.

There is a GitHub repo for some of the code behind PTXprint here: https://github.com/sillsdev/ptx2pdf . I don't know why it is named ptx2pdf instead of PTXprint. This is linked to by this download page on sil.org.

by (495 points)
+1 vote
The difficulty in making a pypi package is that PTXprint is an application and pypi packaging really doesn't lend itself to including all the supporting data directories that are needed for PTXprint. If you'd like to take a shot at it, I would be interested if you can get anywhere.

Having said that, the pyproject.toml file does lend itself to installing from source. That is: pull the repo and pip install -e . or whatever. If you do that you will get a headless ptxprint installation with no gui extras, if you want gui then you'll need something like pip install -e .[gui] but be warned the gui dependencies are steep and do not lend themselves to being installed by pip, you may be better off using other mechanisms (your package manager) for many of the gui specific dependencies.
by (656 points)

Nice. That means I can add this line to requirements.txt:
git+https://github.com/sillsdev/ptx2pdf@master#egg=ptxprint

Then I can install all the dependencies listed in requirements.txt by running pip install -r requirements.txt.

Alternatively, I can use uv like this: uv add 'ptxprint @ git+https://github.com/sillsdev/ptx2pdf'

Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Live in harmony with one another. Do not be proud, but be willing to associate with people of low position. Do not be conceited.
Romans 12:16
3,036 questions
5,992 answers
5,659 comments
2,020 users