I've been trying to properly package my python codes, upload it on git, and install in on an virtual environment all of which I did and seem to work just fine. The issue is that once I pip install my code on the virtual environment, when I run my package as:
python3 -m mypackage
it raises an error suggesting none of the modules that I imported in my __main__.py (my package has one single directory that contains everything: __init__.py, __main__.py, module1.py, etc. ) are seen. However, once I "cd" into where the package is installed in the virtual environment, it can see all the modules and everything works. My guess is there's an issue with my setup.cfg file and I guess the "find" commands are not doing what they are supposed to do
Please also let me know if some other thing could be written more elegantly.
[metadata]
# replace with your username:
name = my_package
version = 0.0.1
author = my_name
author_email = name@email.com
description =
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/myname/mypackage
project_urls =
Bug Tracker = https://github.com/myname/mypackage/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent
[options]
package_dir =
= src
packages = find:
python_requires = >=3.6
install_requires =
numpy > 1.0
opencv-python >= 4.0
[options.packages.find]
where = src