[Python] I need to import a function from a file in vscode using python but "module not found...

Discussão em 'Python' iniciado por Stack, Maio 28, 2025.

  1. Stack

    Stack Membro Participativo

    I have a workspace with different projects as shown below.

    [​IMG]

    I have a code in my main_scripts.py which is under main_scripts sub folder that needs to call a function inside the file config_reader.py which is inside the folder user_functions.

    testing_framework is my current working directory with pyspark_training as my root project.

    My main_script.py looks like this

    [​IMG]

    and my config_reader.py file like this:

    [​IMG]

    I tried to create a dev.env file into the main pyspark_training folder: [​IMG]

    and also i tried modifying the setting for pyspark_training but i am not too sure whether this is correct.

    [​IMG]

    But still getting : ModuleNotFoundError: No module named 'user_functions'

    can anyone help me to solve this? I have gone through a bunch of stack verflow topics covering the issue but to no use. I am still getting the same error.

    Continue reading...

Compartilhe esta Página