pycups icon indicating copy to clipboard operation
pycups copied to clipboard

PIP Installation is broken

Open jamesgeddes opened this issue 1 year ago • 7 comments

When running

pip install pycups

The following is returned.

Collecting pycups
  Downloading pycups-2.0.1.tar.gz (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.0/63.0 kB 5.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycups
  Building wheel for pycups (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      In file included from cupsconnection.c:22:
      cupsconnection.h:26:10: fatal error: cups/http.h: No such file or directory
         26 | #include <cups/http.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycups
  Running setup.py clean for pycups
Failed to build pycups
Installing collected packages: pycups
  Running setup.py install for pycups ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for pycups did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      [dir]/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      In file included from cupsconnection.c:22:
      cupsconnection.h:26:10: fatal error: cups/http.h: No such file or directory
         26 | #include <cups/http.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycups

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

OS: Ubuntu 20.04.5 LTS Python: 3.8.10

jamesgeddes avatar Apr 05 '23 15:04 jamesgeddes

Though it does not suggest this in the error message, the following is required as a prerequisite.

sudo apt-get install libcups2-dev

It would be tremendously helpful if this could be made more clear.

jamesgeddes avatar Apr 05 '23 16:04 jamesgeddes

Hi,

thank you for reporting the issue!

Actually the dependency is mentioned in README file, but if you know how to set it in setup.py, it would be great if you sent a PR.

zdohnal avatar Apr 06 '23 05:04 zdohnal

I do see now that it is mentioned in the documentation, however the expected behavior is that pip install should just work. I'll see if I can work out how to fix this.

jamesgeddes avatar Apr 06 '23 09:04 jamesgeddes

@zdohnal As the pip install is still broken, could this be reopened and assigned to me please?

jamesgeddes avatar Apr 06 '23 09:04 jamesgeddes

Np, I closed the issue because I took it as solved by mentioning the dependency in README file, because I don't know a way how to solve it in pip (unless introducing some kind of configure/cmake solution, which will check the deps before the build, but IMO that's not a Python way of doing it).

zdohnal avatar Apr 11 '23 10:04 zdohnal

Not to mention that installing this on a Windows machine (e. g. for more comfortable development) seems completely impossible.

StarterCraft avatar Jul 22 '23 14:07 StarterCraft

I have tried to solve this in 2.0.2a0 and 2.0.3 versions, but with no luck :( . Probably the project will have to be migrated to newer Python distributing ways...

zdohnal avatar Apr 17 '24 14:04 zdohnal