Rofie Sagara
Rofie Sagara

Reputation: 333

Python3 module 'cups' has no attribute 'Connection'

I try to convert python2 to python3 and there is code not working on `cups.Connection()``

import cups
conn = cups.Connection()

And its produce stacktree

Traceback (most recent call last):
  File "/Users/sagara/Downloads/Printing Script/mnd_75 (latest).py", line 177, in <module>
    conn = cups.Connection()
           ^^^^^^^^^^^^^^^
AttributeError: module 'cups' has no attribute 'Connection'

I already uninstall pycups from This and install it again The python version its Python 3.11.2 with pyenv and the pycups version its

Requirement already satisfied: pycups in /Users/sagara/.pyenv/versions/3.11.2/lib/python3.11/site-packages (2.0.1)

Its maybe cause the device? cause im use M1 not intel or maybe i do wrong in the code?

and i try with terminal and go same error too

Python 3.11.2 (main, Mar 16 2023, 17:42:42) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cups
>>> conn = cups.Connection()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'cups' has no attribute 'Connection'
>>> 

Upvotes: 0

Views: 750

Answers (0)

Related Questions