[Python] Import custom modules in Amazon Sagemaker Jupyter notebook

Discussão em 'Python' iniciado por Stack, Junho 18, 2025.

  1. Stack

    Stack Membro Participativo

    I want to import a custom module in my jupyter notebook in Sagemaker. Trying the import from Untitled1.ipynb I have tried two different structures. The first one is:

    [​IMG]

    Inside "package folder" there were the files "cross_validation.py" and "init.py". The followings commands have been tried:

    from package import cross_validation
    import package.cross_validation


    The second one is

    [​IMG]

    and I have coded import cross_validation

    In both cases I get no error at all when importing, but I can't use the class inside the module because I receive the error name Class_X is not defined

    I also have restarted the notebook, just in case and it still not working. How could I make it?

    Continue reading...

Compartilhe esta Página