Open zbgns opened 1 month ago
Thanks for the report, I will look into this in the next few days.
Oh... I did remember this from somewhere. I do have the fixes in the 1.4.x
branch for this it looks like:
commit e5804a5b76e666c3905ab4e36071bce0012caac5
Author: Merlijn Wajer <merlijn@wizzup.org>
Date: Wed Jun 26 23:56:28 2024 +0200
setup.py: stop using convert_path
This is now deprecated in setuptools
maybe I did not backport the fixes to the 1.5.x master branch - internally we still rely on 1.4.x.
Thank you for the reply.
In the meantime I switched to Debian stable. When I install by pipx install archive-pdf-tools
it apparently goes successfully
installed package archive-pdf-tools 1.5.4, installed using Python 3.11.2
These apps are now globally available
- compress-pdf-images
- epub-to-pdf
- pdf-metadata-json
- pdfcomp
- recode_pdf
but after recode_pdf --version
I have the following
Traceback (most recent call last):
File "/home/zbgns/.local/bin/recode_pdf", line 4, in <module>
from internetarchivepdf.recode import recode
File "/home/zbgns/.local/pipx/venvs/archive-pdf-tools/lib/python3.11/site-packages/internetarchivepdf/__init__.py", line 2, in <module>
from . import mrc
File "/home/zbgns/.local/pipx/venvs/archive-pdf-tools/lib/python3.11/site-packages/internetarchivepdf/mrc.py", line 36, in <module>
from optimiser import optimise_gray, optimise_rgb, optimise_gray2, optimise_rgb2, fast_mask_denoise
File "cython/optimiser.pyx", line 1, in init optimiser
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
I followed your instruction and tried to downgrade version (after uninstalling the current one) pipx install archive-pdf-tools==1.4.14
but the instllation is terminated with the following error message
Fatal error from pip prevented installation. Full pip output in file:
/home/zbgns/.local/pipx/logs/cmd_2024-11-02_11.13.59_pip_errors.log
pip seemed to fail to build package:
archive-pdf-tools==1.4.14
Some possibly relevant errors from pip install:
error: subprocess-exited-with-error
ImportError: cannot import name 'convert_path' from 'setuptools' (/tmp/pip-build-env-wjjk45_t/overlay/lib/python3.11/site-packages/setuptools/__init__.py)
Error installing archive-pdf-tools from spec 'archive-pdf-tools==1.4.14'.
I tried to downgrade it to even earlier version pipx install archive-pdf-tools==1.4.10
and there is still fatal error during installation, although the error message is a bit different
Fatal error from pip prevented installation. Full pip output in file:
/home/zbgns/.local/pipx/logs/cmd_2024-11-02_13.06.42_pip_errors.log
pip seemed to fail to build package:
archive-pdf-tools==1.4.10
Some possibly relevant errors from pip install:
error: subprocess-exited-with-error
AttributeError: 'NoneType' object has no attribute 'is_builtin_type'
Cython.Compiler.Errors.CompileError: cython/optimiser.pyx
Error installing archive-pdf-tools from spec 'archive-pdf-tools==1.4.10'.
Could you try archive-pdf-tools==1.4.29
?
It installs, but unfortunately crashes when i try to run recode_pdf --version
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.2 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "/home/zbgns/.local/bin/recode_pdf", line 4, in <module>
from internetarchivepdf.recode import recode
File "/home/zbgns/.local/pipx/venvs/archive-pdf-tools/lib/python3.11/site-packages/internetarchivepdf/__init__.py", line 2, in <module>
from . import mrc
File "/home/zbgns/.local/pipx/venvs/archive-pdf-tools/lib/python3.11/site-packages/internetarchivepdf/mrc.py", line 36, in <module>
from optimiser import optimise_gray, optimise_rgb, optimise_gray2, optimise_rgb2, fast_mask_denoise
Traceback (most recent call last):
File "/home/zbgns/.local/bin/recode_pdf", line 4, in <module>
from internetarchivepdf.recode import recode
File "/home/zbgns/.local/pipx/venvs/archive-pdf-tools/lib/python3.11/site-packages/internetarchivepdf/__init__.py", line 2, in <module>
from . import mrc
File "/home/zbgns/.local/pipx/venvs/archive-pdf-tools/lib/python3.11/site-packages/internetarchivepdf/mrc.py", line 36, in <module>
from optimiser import optimise_gray, optimise_rgb, optimise_gray2, optimise_rgb2, fast_mask_denoise
File "cython/optimiser.pyx", line 1, in init optimiser
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use '<void>numpy._import_array' to disable if you are certain you don't need it).
Thank you for trying. I will take a look at this, but probably after the weekend. I think you could try to build the package yourself and this error will go away. If you get the source tar for it (or just the latest 1.4.x
branch), and then run python setup.py bdist_wheel
. You can also try to set up a virtual env and ensure the numpy version isn't 2.x.
Thanks, I'm really grateful. I will try to build it later on, although my knowledge on is very limited.
I have tried to install the program using
pipx
on Debian Testing with commandpipx install archive-pdf-tools
. There is an error that prevents the installation, and Python outputs the following logBTW I have the same on Manjaro. I also tried installing it directly by
pip3
with--break-system-packages
flag and the error output is pretty much the same on both systems. On the other hand I was able to install it on Ubuntu 24.04 about a year ago and it still works.