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 pyhrv' gets 'no module tkinter error' #1145

Closed
ChaeYeon01 opened this issue Apr 25, 2024 · 3 comments
Closed

'import pyhrv' gets 'no module tkinter error' #1145

ChaeYeon01 opened this issue Apr 25, 2024 · 3 comments

Comments

@ChaeYeon01
Copy link

ChaeYeon01 commented Apr 25, 2024

Chaquopy version

15.0

Devices or emulators where the issue happens

Relevant parts of your code

python script
import cv2
import numpy as np
import time
import pyhrv

build.gradle
chaquopy{
defaultConfig {
version = "3.8"
pip{
install("opencv-python")
install("numpy")
install("spectrum")
install("scipy")
install("pyhrv")
}
}

Describe your issue

I need to import pyhrv.
but when I import pyhrv, I get
com.chaquo.python.PyException: ModuleNotFoundError: No module named 'tkinter'
(Even if I don't put any funtion of pyhrv, just only import pyhrv, it says same error)

I know chaquopy doesn't support tkinter.
But I don't need to use tkinter. I don't use and write it anywhere.
Is pyhrv using tkinter??? Is pyhrv related to tkinter?

Why does pyhrv out tkinter error although I don't use tkinter?
And how can I use pyhrv without tkinter error?

@mhsmith
Copy link
Member

mhsmith commented Apr 25, 2024

Please post the full stack trace, as described at https://stackoverflow.com/a/23353174.

@ChaeYeon01
Copy link
Author

ChaeYeon01 commented Apr 26, 2024

Oh I'm so sorry..!

here:

pyhrv_cv1
pyhrv_cv2
pyhrv_cv3

@mhsmith mhsmith changed the title How to use pyhrv ('import pyhrv' gets 'no module tkinter error' although tkinter isn't used) 'import pyhrv' gets 'no module tkinter error' Apr 26, 2024
@mhsmith
Copy link
Member

mhsmith commented Apr 26, 2024

I suggest you report this to the biosppy project, and request them to tolerate the situation where tkinter is unavailable.

Unfortunately I can't see any simple workaround. Adding a fake tkinter module to sys.modules isn't enough, because biosppy/inter_plotting/ecg.py also unconditionally imports matplotlib.backends.backend_tkagg, which itself imports many other tkinter modules and classes.

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