try the following and then do your import:
pip install data
Answer from SuhailY on Stack Overflowtry the following and then do your import:
pip install data
The line
from data import batch_gen, encode
lets you import only parts of modules and gives you the possibility to reference them directly without writing data.encode
So to get this running you need a module called data in a file, either a file in the same location as your python file or in the installation folder where the other std python files life. otherwise you would always get an error. more information is easily found here: https://www.digitalocean.com/community/tutorials/how-to-import-modules-in-python-3#using-from-%E2%80%A6-import
No Module named Data
Help with ModuleNotFoundError: No module named 'Dataloader' !pip not working
ModuleNotFoundError: No module named 'data_modules' - AI & Machine learning - Quantra Community
ModuleNotFoundError: No module named 'data.load_data'
What is Python ModuleNotFoundError and what causes it?
Where can I find more ModuleNotFoundError fixes?
Is ModuleNotFoundError the same as ImportError?
hey reddit (first post)
I made a little face recognition program with opencv and opened it in my text editor (Atom) just fine. later i came back to work on it again and suddenly it have me this message:
Traceback (most recent call last): File "/home/meow/Desktop/Projects/faces-train.py", line 1, in <module> import cv2 File "/home/meow/.local/lib/python2.7/site-packages/cv2/__init__.py", line 3, in <module> from .data import * ImportError: No module named data [Finished in 0.199s]
im new to coding in general, so i dont have a lot of experience with debugging and finding errors.
Thanks for your time