You are not logged in.

#1 2024-05-10 11:46:02

Safri
Member
Registered: 2024-05-10
Posts: 4

[SOLVED] Python package "mokuro" failing execute after system update

Specifically this fork of mokuro that I installed with "pipx install git+https://github.com/ZXY101/mokuro.git@master"

Traceback (most recent call last):
  File "/home/safri/.local/bin/mokuro", line 5, in <module>
    from mokuro.__main__ import main
  File "/home/safri/.local/share/pipx/venvs/mokuro/lib/python3.12/site-packages/mokuro/__init__.py", line 3, in <module>
    from mokuro.manga_page_ocr import MangaPageOcr
  File "/home/safri/.local/share/pipx/venvs/mokuro/lib/python3.12/site-packages/mokuro/manga_page_ocr.py", line 7, in <module>
    from comic_text_detector.inference import TextDetector
  File "/home/safri/.local/share/pipx/venvs/mokuro/lib/python3.12/site-packages/comic_text_detector/inference.py", line 11, in <module>
    from comic_text_detector.basemodel import TextDetBase, TextDetBaseDNN
  File "/home/safri/.local/share/pipx/venvs/mokuro/lib/python3.12/site-packages/comic_text_detector/basemodel.py", line 9, in <module>
    from comic_text_detector.models.yolov5.yolo import load_yolov5_ckpt
  File "/home/safri/.local/share/pipx/venvs/mokuro/lib/python3.12/site-packages/comic_text_detector/models/yolov5/yolo.py", line 4, in <module>
    from comic_text_detector.utils.yolov5_utils import scale_img, check_version, check_anchor_order, initialize_weights, \
  File "/home/safri/.local/share/pipx/venvs/mokuro/lib/python3.12/site-packages/comic_text_detector/utils/yolov5_utils.py", line 4, in <module>
    import pkg_resources as pkg
ModuleNotFoundError: No module named 'pkg_resources'

Is the response I get upon executing "mokuro" in any fashion

I've tried:
- yay -Syu
- sudo pacman -Syu
- pipx reinstall-all
- pipx upgrade-all
- pipx uninstall setuptools
- sudo pacman -Rcn python-setuptools (some forums post said this should work)

Note that after I updated my system none of my python packages worked but this is just the only one that continued to not work after reinstalling the packages

Versions (don't know what is needed so I'll just throw stuff out there)
Python 3.12.3
pipx 1.5.0
pacman 6.1.0
yay 12.3.5

thank you for any help.

Last edited by Safri (2024-05-12 12:26:54)

Offline

#2 2024-05-11 07:25:06

AaAaAAaaAAaARCH
Member
Registered: 2024-02-29
Posts: 42

Re: [SOLVED] Python package "mokuro" failing execute after system update

- pipx uninstall setuptools
- sudo pacman -Rcn python-setuptools (some forums post said this should work)

Does this not effectively remove the package from your system, did you try re-installing it?

Maybe the venv does not have access to the system packages

pipx inject --system-site-packages mokuro
pipx run --system-site-packages mokuro

https://pipx.pypa.io/latest/docs/

You can test it outside of your venv

python -c "import pkg_resources"

Last edited by AaAaAAaaAAaARCH (2024-05-11 07:27:25)

Offline

#3 2024-05-11 19:45:54

Safri
Member
Registered: 2024-05-10
Posts: 4

Re: [SOLVED] Python package "mokuro" failing execute after system update

Does this not effectively remove the package from your system, did you try re-installing it?

It does uninstall it but reinstalling doesn't seem to do anything

$ pipx inject --system-site-packages mokuro
usage: pipx inject [-h] [--quiet] [--verbose] [--include-apps] [--include-deps]
                   [--system-site-packages] [--index-url INDEX_URL] [--editable] [--pip-args PIP_ARGS]
                   [--force] [--with-suffix]
                   package dependencies [dependencies ...]
pipx inject: error: the following arguments are required: dependencies
$ pipx run --system-site-packages mokuro
⚠️  mokuro is already on your PATH and installed at /home/safri/.local/bin/mokuro. Downloading and
    running anyway.
/home/safri/.cache/pipx/89959f784596e78/lib/python3.12/site-packages/torch/cuda/__init__.py:619: UserWarning: Can't initialize NVML
  warnings.warn("Can't initialize NVML")
2024-05-11 14:41:52.900 | ERROR    | mokuro.run:run:30 - Found no paths to process. Did you set the paths correctly?
$ python -c "import pkg_resources"
<string>:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

my guess is that there's something wrong with the dependencies, do you have any idea how I could reinstall the needed dependencies?

Offline

#4 2024-05-11 21:13:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,991

Re: [SOLVED] Python package "mokuro" failing execute after system update

pipx install setuptools

?

Offline

#5 2024-05-12 00:34:21

Safri
Member
Registered: 2024-05-10
Posts: 4

Re: [SOLVED] Python package "mokuro" failing execute after system update

$ pipx install setuptools 
No apps associated with package setuptools or its dependencies. If you are attempting to install a
library, pipx should not be used. Consider using pip or a similar tool instead.
$ pip install setuptools 
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.
    
    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

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.
$ sudo pacman -S python-setuptools

is the only thing that lets me install it but even after reinstalling, mokuro still fails to launch

Offline

#6 2024-05-12 02:25:20

AaAaAAaaAAaARCH
Member
Registered: 2024-02-29
Posts: 42

Re: [SOLVED] Python package "mokuro" failing execute after system update

You can try

pipx inject mokuro setuptools
pipx upgrade  --system-site-packages mokuro
pipx inject --system-site-packages mokuro setuptools

or try re-installing mokuro

Last edited by AaAaAAaaAAaARCH (2024-05-12 02:31:53)

Offline

#7 2024-05-12 11:57:46

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: [SOLVED] Python package "mokuro" failing execute after system update

As documented in the changelog for Python 3.12, setuptools is not installed by default in venvs anymore. So just `pipx install mokuro` and then `pipx inject mokuro setuptools` is needed (at least until mokuro is updated to explicitly state this dependency). None of that `--system-site-packages` stuff is required.

Offline

#8 2024-05-12 12:22:43

Safri
Member
Registered: 2024-05-10
Posts: 4

Re: [SOLVED] Python package "mokuro" failing execute after system update

Thank you for help!!! It's working now 'pipx inject mokuro setuptools' was all that was neccesary.

Offline

Board footer

Powered by FluxBB