I have a custom module called my_module. It is structured like this:
<my_module>
__init__.py
file_1_with_methods.py
setup.py
subdirectory
__init__.py
file_2_with_methods.py
etc.
__init__.py
is empty. setup.py looks like this
from setuptools import setup, find_packages
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='<my_module>'
, author = '<me>'
, author_email ='<my_email>'
, version='1.0.0'
, description='<descriptiong>'
, packages = find_packages()
, install_requires = required
, include_package_data=True # include non-python files in the install
)
I installed it using
pip install /path/to/my/module
I know it is installed to the same location as all my other packages because I ran
pip list -v
and the Location is the same as all the others. I verified that the location is in the python path using
import sys
sys.path
I also verified that I am using the same user (root) for both the install, and when running the import call.
Furthermore I only have one installed version of python.
That covers everything mentioned here 1
I tried asking chatGPT and it mentioned confirming the name of the package (done), but didn't really have anything else to contribute.