Traceback (most recent call last):
File "/usr/bin/stapler", line 5, in <module>
from staplelib import main
ModuleNotFoundError: No module named 'staplelib'
To solve it, rebuild "python-pypdf2" and then "stapler". Then the directories for Python 3.9 should exist.
This is a very usefull tool and apparently gets a lot of votes too.
Thanks to everyone involved in providing these very usefull python pdf tools.
Stapler doesnt get many github commits (last one are from more than one year ago).
And it can be a lot of trouble work to maintain the PKGBUILD due to the dependency on python-pypdf2.
Just want to chime in and suggest an alternative than may also be interesting to the same maintainers and users of this PKGBUILD.
captn3m0/pystitcher: pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative markdown file as input
It seems polished and provides the same stapling/stiching functionality.
also published on pypi
it dependes not on pypdf2, but pypd3
Pypdf3 seems better maintained. sfneal/PyPDF3: A utility to read and write PDFs with Python , which is also on pypi . https://pypi.org/project/PyPDF3/
Pypdf3 is already on AUR, https://aur.archlinux.org/packages/python-pypdf3
Pypdf2 last commits are from 2018.
I did a quick test and it seems to work as it says on the can:
It seems to work perfectly with:
pipx install pystitcher
python -m venv testing_pystitcher
cd ./testing_pystitcher
source bin/activate
pip install pypdf3
pip install pystitcher
As python 3.8 was replaced by python 3.9, you could run into the following error:
Traceback (most recent call last):
File "/usr/bin/stapler", line 5, in <module>
from staplelib import main
ModuleNotFoundError: No module named 'staplelib'
To solve it, rebuild "python-pypdf2" and then "stapler". Then the directories for Python 3.9 should exist.
update fails with
Installing collected packages: stapler
Successfully installed stapler-1.0.0
rm: cannot remove '/run/media/rich/8TbSeagate/yay/stapler/pkg/stapler/usr/bin/pdf-stapler': No such file or directory
==> ERROR: A failure occurred in package().
Aborting...
error making: %!s(func() string=0x55b0858a3410)
@m040601 Hi, I adopted the project, so I can only speculate for the reasons of choosing /opt. According to https://wiki.archlinux.org/index.php/Arch_package_guidelines#Directories, /opt should be used for "Large self-contained packages".
It is not large, but arguably self-contained. Or is it a use case to use the library, not just the executable? (I only use the /usr/bin/stapler executable.)
I don't have a strong opinion for either way. As m040601 pointed out, the stapler-git shows how it can be done, so it should not be hard. If it is a better structure, I can change it.