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

Type Error on import twain #42

Open
furqanazhar opened this issue Feb 16, 2024 · 3 comments
Open

Type Error on import twain #42

furqanazhar opened this issue Feb 16, 2024 · 3 comments

Comments

@furqanazhar
Copy link

furqanazhar commented Feb 16, 2024

I am facing issue right on the first line.

OS : Windows 10 64-bit

import twain

Traceback (most recent call last):
File "C:\Users\DELL\PycharmProjects\DocScanner1\main.py", line 1, in
import twain
File "C:\Users\DELL\PycharmProjects\DocScanner1\venv\lib\site-packages\twain_init_.py", line 12, in
from .lowlevel.structs import *
File "C:\Users\DELL\PycharmProjects\DocScanner1\venv\lib\site-packages\twain\lowlevel\structs.py", line 174, in
def frame2tuple(frame: TW_FRAME) -> tuple[float, float, float, float]:
TypeError: 'type' object is not subscriptable

@denisenkom
Copy link
Owner

What is your Python version? You are probably using unsupported version, oldest supported version is 3.8

@furqanazhar
Copy link
Author

Preivously, I had python 3.8 installed but still same issue so i upgraded to python 3.12 and got it running. But now when i click scan button, below error pops up, can you help me here?

INFO:twain:attempting to load dll: twaindsm.dll
ERROR:twain:load failed with error Could not find module 'twaindsm.dll' (or one of its dependencies). Try using the full path with constructor syntax

@denisenkom
Copy link
Owner

Here https://pytwain.readthedocs.io/en/latest/ you can find some information on how to install twaindsm.dll

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