0

I want to install some apps I have developed and are hosted on my own git service but since it appears they have been correctly installed, when I add them to INSTALLED_APPS throws me a ModuleNotFoundError

This is my setup file for the app

setup(
    name='my-teams',
    version='0.1',
    packages=find_packages(),
    include_package_data=True,
    license='GPL',
    description='Teams app',
    long_description=README,
    url='https://<url>/my-teams',
    author='...',
    author_email='...',
    classifiers=[
        ...
    ],
    install_requires=[requirements],
)

This is my settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'my_teams',
]

And this is what I've added to my requirements.txt file:

-e git+https://<url>/my-teams.git@master#egg=my_teams

When I install requirements.txt it seems to be okay:

Found existing installation: my-teams 0.1
    Uninstalling my-teams-0.1:
      Successfully uninstalled my-teams-0.1

And it appears when I execute pip freeze

-e git+https://<url>/my-teams.git@cfa8cbf84d8d91ce573f33da3156e8f7f241d63a#egg=my_teams

Finally, when I run python manage.py runserver it throws me the exception:

ModuleNotFoundError: No module named 'my_teams'

Could you please tell me what I'm doing wrong or what I'm missing?

Thank you!

1 Answers1

0

You have mentioned the name in the setup as 'my-teams', please change it into 'my-teams' in installed apps in settings.py

  • modules with "-" work in Python? I don't think so (https://stackoverflow.com/questions/7583652/python-module-with-a-dash-or-hyphen-in-its-name) – Matthieu Brucher Dec 13 '18 at 11:27