0 votes
39 vues

Bonjour !
Sous Ubuntu 24.04.2 LTS, j'ai PTXprint, version d'hier (python3-ptxprint/noble,noble,now 2.8.20-0~20250709~ubuntu24.04.1 all [installed]) et il refuse de démarrer. Cela a commencé à se produire il y a une semaine. Je n'ai pas de fichier usfmtc sur mon système.

pc@pc:~/Dokumenti/GitHub/SloKJV/PTXprint$ ptxprint
Traceback (most recent call last):
  File "/usr/bin/ptxprint", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3/dist-packages/ptxprint/main.py", line 145, in main
    from ptxprint.gtkview import GtkViewModel, getPTDir, reset_gtk_direction
  File "/usr/lib/python3/dist-packages/ptxprint/gtkview.py", line 29, in <module>
    from ptxprint.view import ViewModel, Path, VersionStr, GitVersionStr
  File "/usr/lib/python3/dist-packages/ptxprint/view.py", line 3, in <module>
    from ptxprint.texmodel import TexModel, Borders, _periphids
  File "/usr/lib/python3/dist-packages/ptxprint/texmodel.py", line 7, in <module>
    from ptxprint.usxutils import Usfm, Sheets
  File "/usr/lib/python3/dist-packages/ptxprint/usxutils.py", line 2, in <module>
    import usfmtc
ModuleNotFoundError: No module named 'usfmtc'

L'installation via pip n'est pas utile (Python 3.12.3)

pc@pc:~/Dokumenti/GitHub/SloKJV/PTXprint$ python3 -m pip install usfmtc
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.


    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.


    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.


    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Je ne trouve pas ce fichier sur GitHub - sillsdev/ptx2pdf: XeTeX based macro package for typesetting USFM formatted (Paratext output) scripture files
https://github.com/sillsdev/ptx2pdf/tree/master

Il semble que /usr/lib/python3/dist-packages/ptxprint/usxutils.py l'utilise

==========usxutils.py=======
import re, regex, logging, os, time
import usfmtc
from usfmtc.reference import Ref, RefList
from usfmtc.usfmparser import Grammar
from ptxprint.utils import universalopen, runChanges
from usfmtc.xmlutils import ParentElement, hastext, isempty
from usfmtc.usxmodel import iterusx, addesids
from ptxprint.changes import readChanges
from ptxprint.ptsettings import PTEnvironment
from copy import deepcopy
...
===========================

Traduit automatiquement depuis English
PTXprint par (104 points)
modifié par | 39 vues

1 Réponse

0 votes
Nous devons faire mieux à ce sujet, probablement en empaquetant usfmtc. En attendant, il est sans danger de briser le verrouillage pour cela, soit en utilisant l'option de ligne de commande, soit en renommant /usr/lib/python3.12/EXTERNALLY-MANAGED (ou un fichier similaire) en autre chose. Cela permettra l'installation du paquet.
Traduit automatiquement depuis English
par (656 points)

Ça fonctionne maintenant. Merci.

root@pc:/usr/lib/python3.12# oot@pc:/usr/lib/python3.12# mv EXTERNALLY-MANAGED EXTERNALLY-MANAGED_RENAMED
root@pc:/usr/lib/python3.12# python3 -m pip install usfmtc
Collecting usfmtc
  Downloading usfmtc-0.3.12-py3-none-any.whl.metadata (1.2 kB)
Collecting rply (from usfmtc)
  Downloading rply-0.7.8-py2.py3-none-any.whl.metadata (4.2 kB)
Requirement already satisfied: regex in /usr/lib/python3/dist-packages (from usfmtc) (2022.10.31)
Requirement already satisfied: appdirs in /usr/lib/python3/dist-packages (from rply->usfmtc) (1.4.4)
Downloading usfmtc-0.3.12-py3-none-any.whl (83 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.7/83.7 kB 1.2 MB/s eta 0:00:00
Downloading rply-0.7.8-py2.py3-none-any.whl (16 kB)
Installing collected packages: rply, usfmtc
Successfully installed rply-0.7.8 usfmtc-0.3.12
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@pc:/usr/lib/python3.12# root@pc:/usr/lib/python3.12# mv EXTERNALLY-MANAGED_RENAMED EXTERNALLY-MANAGED
Traduit automatiquement depuis English

Questions connexes

0 votes
1 réponse 21 vues
J'utilise Ubuntu 25.04 et j'ai installé ptxprint de cette manière : sudo apt install python3-ptxprint Je ... cette version de Python ne possède pas l'attribut _posix_flavour.
bit 495 posée oct. 8, 2025
0 votes
1 réponse 114 vues
J'ai un module Bible lectionnaire qui possède ses propres en-têtes \s#. Il n'y a pas de \inc s dans le ... Mais je me demande si je ne manque pas un paramètre quelque part ?
beve 128 posée avr. 10, 2025
0 votes
2 réponses 70 vues
Dans un module Bible de type lectionnaire, nous avons des en-têtes avec des références bibliques. Par exemple : \s1 $(JER 33: ... sortie est la même. J'utilise la version 2.7.29.
beve 128 posée avr. 16, 2025
0 votes
1 réponse 126 vues
J'ai un module de la Bible pour le lectionnaire, et dans PTXPrint, certains textes \ref sont manquants, et d' ... je rate, concernant les paragraphes ou quelque chose d'autre ?
beve 128 posée avr. 10, 2025
0 votes
1 réponse 59 vues
Nous travaillons sur un module de la Bible et avons mis à niveau vers la v 2.5.6 pour que les notes de bas de ... affichent pas, bien que les notes de bas de page s'affichent.)
anon399461 123 posée nov. 20, 2024
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Very truly I tell you, whoever accepts anyone I send accepts me; and whoever accepts me accepts the one who sent me.
John 13:20
3,046 questions
6,006 réponses
5,671 commentaires
2,026 utilisateurs