Following is my python package structure
pkg |-- src |-- data |-- __init__.py |-- loader1.py |-- dataset |-- __init__.py |-- loader2.py |-- utils |-- __init__.py |-- chk.py |-- setup.py |-- __init__.py |-- LICENSE |-- README.md After pip installation I wanted to use from pkg.data.loader1 import func and so I used from pkg.data.loader1 import func (in linux terminal). As a result, I got ModuleNotFoundError: No module named in response.
How can I fix this.
Edit: setup.py
from setuptools import setup with open("README.md", 'r') as fh: long_description = fh.read() setup( name="pkg", version="0.0.1", description="will add", long_description=long_description, long_description_content_type="text/markdown", author="my name", packages=['pkg'], install_requires=[] )
setup.pyin your post?pip install -e .before trying to import, right?pip3 install pkg.whl@Arne__init__.pyfile directly underpkg, and 2) importfind_packagesas well, and in yoursetupcall updatepackages=find_packages("pkg")