Package Details: pix2tex 0.1.4-1

Git Clone URL: https://aur.archlinux.org/pix2tex.git (read-only, click to copy)
Package Base: pix2tex
Description: Using a ViT to convert images of equations into LaTeX code
Upstream URL: https://github.com/lukas-blecher/LaTeX-OCR
Licenses: MIT
Conflicts: python-pix2tex
Provides: latexocr, pix2tex, python-pix2tex
Replaces: python-pix2tex
Submitter: AlphaJack
Maintainer: AlphaJack
Last Packager: AlphaJack
Votes: 4
Popularity: 0.069467
First Submitted: 2023-11-04 09:39 (UTC)
Last Updated: 2025-02-15 15:13 (UTC)

Latest Comments

ReFleXzZ commented on 2025-10-31 11:01 (UTC)

Upon installing I got the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import transformers
  File "/home/sebastian/.cache/paru/clone/python-transformers/src/transformers-4.56.2/src/transformers/__init__.py", line 27, in <module>
    from . import dependency_versions_check
  File "/home/sebastian/.cache/paru/clone/python-transformers/src/transformers-4.56.2/src/transformers/dependency_versions_check.py", line 57, in <module>
    require_version_core(deps[pkg])
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/home/sebastian/.cache/paru/clone/python-transformers/src/transformers-4.56.2/src/transformers/utils/versions.py", line 117, in require_version_core
    return require_version(requirement, hint)
  File "/home/sebastian/.cache/paru/clone/python-transformers/src/transformers-4.56.2/src/transformers/utils/versions.py", line 111, in require_version
    _compare_versions(op, got_ver, want_ver, requirement, pkg, hint)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.cache/paru/clone/python-transformers/src/transformers-4.56.2/src/transformers/utils/versions.py", line 44, in _compare_versions
    raise ImportError(
        f"{requirement} is required for a normal functioning of this module, but found {pkg}=={got_ver}.{hint}"
    )
ImportError: huggingface-hub>=0.34.0,<1.0 is required for a normal functioning of this module, but found huggingface-hub==1.0.1.
Try: `pip install transformers -U` or `pip install -e '.[dev]'` if you're working with git main

codeIMperfect commented on 2025-09-13 11:54 (UTC)

Apparently this error is caused by using albumentations v2.0 and has been reported already.

But their fix is to explicitly install albumentations v1.4 in their setup.py, which we on arch obviously can't do

codeIMperfect commented on 2025-09-13 10:27 (UTC) (edited on 2025-09-13 10:27 (UTC) by codeIMperfect)

I'm getting an error on running pix2tex too but it's a bit different from @krvkir

Traceback (most recent call last):
  File "/usr/bin/pix2tex", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.13/site-packages/pix2tex/__main__.py", line 27, in main
    from .cli import main
  File "/usr/lib/python3.13/site-packages/pix2tex/cli.py", line 1, in <module>
    from pix2tex.dataset.transforms import test_transform
  File "/usr/lib/python3.13/site-packages/pix2tex/dataset/transforms.py", line 1, in <module>
    import albumentations as alb
  File "/usr/lib/python3.13/site-packages/albumentations/__init__.py", line 18, in <module>
    from .augmentations import *
  File "/usr/lib/python3.13/site-packages/albumentations/augmentations/__init__.py", line 1, in <module>
    from .blur.transforms import *
  File "/usr/lib/python3.13/site-packages/albumentations/augmentations/blur/transforms.py", line 34, in <module>
    from albumentations.core.transforms_interface import (
    ...<2 lines>...
    )
  File "/usr/lib/python3.13/site-packages/albumentations/core/transforms_interface.py", line 545, in <module>
    class DualTransform(BasicTransform):
    ...<207 lines>...
            return np.stack([self.apply_to_mask3d(mask3d, **params) for mask3d in masks3d])
  File "/usr/lib/python3.13/site-packages/albumentations/core/transforms_interface.py", line 725, in DualTransform
    @batch_transform("spatial", has_batch_dim=False, has_depth_dim=True)
     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: batch_transform() got an unexpected keyword argument 'has_batch_dim'

MareDevi commented on 2025-03-22 07:24 (UTC)

same error with @krvkir

krvkir commented on 2024-08-25 17:16 (UTC) (edited on 2024-08-26 12:20 (UTC) by krvkir)

I get an error when I run pix2tex command:

Traceback (most recent call last):
  File "/usr/bin/pix2tex", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/pix2tex/__main__.py", line 28, in main
    main(arguments)
  File "/usr/lib/python3.12/site-packages/pix2tex/cli.py", line 224, in main
    model = LatexOCR(arguments)
            ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pix2tex/cli.py", line 84, in __init__
    self.model.load_state_dict(torch.load(self.args.checkpoint, map_location=self.args.device))
  File "/usr/lib/python3.12/site-packages/torch/nn/modules/module.py", line 2189, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Model:
Missing key(s) in state_dict: "decoder.net.token_emb.emb.weight", "decoder.net.attn_layers.layers.0.0.0.weight" 
[... long list of missing keys ...]
Unexpected key(s) in state_dict: "decoder.net.token_emb.weight", "decoder.net.attn_layers.layers.0.0.weight", "decoder.net.attn_layers.layers.0.0.bias"
[... long list of keys it didn't expect to find ...]

Seems that pytorch expects the model file in some other format than provided in the package.

Could anyone give me a clue where the problem is? Is it in AUR package or in pix2tex python package itself?

PS When I run it inside docker using the image provided by package author, everything works fine, so the model files should be correct. Maybe PyTorch version is wrong?

MarsSeed commented on 2023-07-04 14:59 (UTC)

In accordance with Python package naming rules, please change pkgname in PKGBUILD to pix2tex, and resubmit under that name to AUR. Thank you.

Freed commented on 2023-06-16 11:14 (UTC)

@lfajtak I have a long time not to use this program. I've added you to maintainer and if something cannot work, you can do some fix instantly.

lfajtak commented on 2022-12-19 11:06 (UTC) (edited on 2022-12-19 11:07 (UTC) by lfajtak)

Upon install, I noticed the following missing dependencies:

  • gnome-screenshot (optional)
  • python-screeninfo
  • python-pynput
  • python-pyqt5-webengine