Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error during installation #70

Open
zbgns opened this issue Oct 30, 2024 · 7 comments
Open

error during installation #70

zbgns opened this issue Oct 30, 2024 · 7 comments

Comments

@zbgns
Copy link

zbgns commented Oct 30, 2024

I have tried to install the program using pipx on Debian Testing with command pipx install archive-pdf-tools. There is an error that prevents the installation, and Python outputs the following log

PIP STDOUT
----------
Collecting archive-pdf-tools
  Using cached archive-pdf-tools-1.5.4.tar.gz (194 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'


PIP STDERR
----------
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/home/zbgns_debian/.local/share/pipx/shared/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/zbgns_debian/.local/share/pipx/shared/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/zbgns_debian/.local/share/pipx/shared/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-yrt108ie/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-yrt108ie/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 303, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-yrt108ie/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 521, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-yrt108ie/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 319, in run_setup
          exec(code, locals())
        File "<string>", line 2, in <module>
      ImportError: cannot import name 'convert_path' from 'setuptools' (/tmp/pip-build-env-yrt108ie/overlay/lib/python3.12/site-packages/setuptools/__init__.py)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

BTW 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.

@MerlijnWajer
Copy link
Collaborator

Thanks for the report, I will look into this in the next few days.

@MerlijnWajer
Copy link
Collaborator

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 <[email protected]>
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.

@zbgns
Copy link
Author

zbgns commented Nov 2, 2024

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'.

@MerlijnWajer
Copy link
Collaborator

Could you try archive-pdf-tools==1.4.29 ?

@zbgns
Copy link
Author

zbgns commented Nov 2, 2024

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).

@MerlijnWajer
Copy link
Collaborator

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.

@zbgns
Copy link
Author

zbgns commented Nov 2, 2024

Thanks, I'm really grateful. I will try to build it later on, although my knowledge on is very limited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants