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

ImportError: cannot import name 'DeviceNotFoundError' from 'escpos.exceptions' #629

Open
Torreblanca opened this issue Feb 28, 2024 · 2 comments

Comments

@Torreblanca
Copy link

Hi. with 'from escpos.printer import Usb' I get the next error ever ...

I have:

  • [x ] searched open and closed issues for duplicates

Bug description

Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Scripts\python-escpos.exe_main
.py", line 4, in
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\escpos\cli.py", line 21, in
from . import config
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\escpos\config.py", line 12, in
from . import printer
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\escpos\printer_init
.py", line 4, in
from .cups import CupsPrinter
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\escpos\printer\cups.py", line 17, in
from ..exceptions import DeviceNotFoundError
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'DeviceNotFoundError' from 'escpos.exceptions' (C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\escpos\exceptions.py)

Steps to reproduce

  • from escpos.printer import Usb

Device info

Printer: Manufacturer Model XVI

python-escpos version: --pre

python version: 03.11 x64

operating system: Windows 10

@belono
Copy link
Contributor

belono commented Feb 28, 2024

Hi @Torreblanca and welcome to python-escpos!

I've just freshly pip installed python-escpos on a Windows 10 VM and I can't reproduce your issue.

What are the steps you follow for your installation?

Additionally, you can find the recommended installation steps in the installation guide.

@ShaoVN
Copy link

ShaoVN commented Apr 19, 2024

@Torreblanca I recently experienced a similar issue. I fixed it by ensuring all dependencies are installed, and that I am grabbing the most recent version.
I installed gcc, python3-dev, aand libcups2-dev as well as running pip3 install python-escpos[all] to force all packages and install the most recent version.
I hope this helps, good luck!

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

3 participants