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

Pycups pip installation error #61

Open
Roboflex30 opened this issue May 30, 2024 · 0 comments
Open

Pycups pip installation error #61

Roboflex30 opened this issue May 30, 2024 · 0 comments

Comments

@Roboflex30
Copy link

Hi, I am trying to print a file in one of my 3 printers( I want the printers to be selected dynamically i.e. as per my use). But I am getting an error. The error goes as follows
**Collecting pycups
Using cached pycups-2.0.4.tar.gz (65 kB)
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
╰─> [1 lines of output]
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[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
ERROR: Could not build wheels for pycups, which is required to install pyproject.toml-based projects**

Can someone help me with this? I am using below code for my use case
import cups

def print_file(file_path, printer_name):

conn = cups. Connection()

printers = conn.getPrinters()

if printer_name in printers:
    try:
        conn.printFile(printer_name, file_path, "Print Job", {})
        print("File sent to printer successfully.")
    except cups.IPPError as e:
        print(f"Error printing file: {e}")
else:
    print(f"Printer '{printer_name}' not found.")
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

1 participant