'failed to get real commands on module "": python process died with code 1

I have a Django project in which I created several custom Django management commands. For some reason I can't explain, I got this error:

"failed to get real commands on module "": python process died with code 1: command '' took too long and may freeze everything. consider adding it to 'skip commands' list"

Although there are many questions on Stackoverflow on this topic I can't find the reason of why I am getting this error. It doesn't seem to me that this is a Pycharm bug (like in 2015). Could someone explain this error to me? What is it due to?

from datetime import datetime, timedelta
from django.core.management.base import BaseCommand
from external_data.web_scrapper.scrap import ScrapDotCom
from my_project.settings import STATICFILES_DIRS


class Command(BaseCommand):
    help = ("Cubic spline interpolation is used to deal with missing data")

def add_arguments(self, parser):
    # Positional arguments
    parser.add_argument(
        "frequency",
        nargs=1,
        type=str,
    )

def handle(self, *args, **options):
    final_date = datetime.now().strftime('%d/%m/%Y')
    initial_date = datetime.now() - timedelta(days=365) 
    initial_date = initial_date.strftime('%d/%m/%Y')

    path = STATICFILES_DIRS[0] + '/external_data/csv/my_website'
    inst = ScrapDotCom.from_fund_constant_file(initial_date, final_date, path)
  
    inst.full_process_download('[email protected]', 'mycode',
                            'my_path')

The class scrapDotCom has a lot of methods so it is difficult for me to post the whole script here because we are talking about 500 lines.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source