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

Import of imp breaks with Python 3.12 #722

Closed
cheri-burnet opened this issue Nov 8, 2023 · 3 comments
Closed

Import of imp breaks with Python 3.12 #722

cheri-burnet opened this issue Nov 8, 2023 · 3 comments

Comments

@cheri-burnet
Copy link

cheri-burnet commented Nov 8, 2023

serial\utilities\_init_.py imports imp. imp is removed in Python 3.12 so the import of serial no longer works

import serial
Traceback (most recent call last):
File "", line 1, in
File "c:\python312\lib\site-packages\serial\_init_.py", line 10, in
from . import utilities, abc, model, marshal, errors, properties, meta, hooks, test, request
File "c:\python312\lib\site-packages\serial\utilities\_init_.py", line 5, in
compatibility.backport() # noqa
^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\python312\lib\site-packages\serial\utilities\compatibility.py", line 28, in backport
exec(BACKWARDS_COMPATIBILITY_IMPORTS, frame.f_globals, frame.f_locals)
File "", line 4, in
File "c:\python312\lib\site-packages\future\standard_library\_init_.py", line 65, in
import imp
ModuleNotFoundError: No module named 'imp'

@Knio
Copy link

Knio commented Nov 15, 2023

@Knio
Copy link

Knio commented Nov 15, 2023

FYI:
this error is from the serial library, not pyserial (gets me every time)

@cheri-burnet
Copy link
Author

FYI: this error is from the serial library, not pyserial (gets me every time)

You're right, thank you! My fault, I had both libraries installed and they use the same import statement. I didn't look close enough at the file reference.

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