Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97355

setup root folder in vs code in a python project

$
0
0

I have a project called hello, and path to this project is /home/Ubuntu/work/greetings/hello. my virtual environment named hello is created in /home/ubuntu/work/virtaul_environments/hello.

My project structure is something like below:

|-greetings
    |-hello
        |-hello_to_family
            |-say.py
        |-hello_to_friend
            |-say.py
        |-utils
            |-utils.py

in above structure every say.py contains import from greetings folder.

from greetings.hello.utils.utils import good_morning

Now the problem is my interpreter does not recognize greetings folder, it says

ModuleNotFoundError: No module named 'greetings'

My settings.json file contains:

{
    "python.pythonPath":"/home/ubuntu/work/virtual_environments/hello/bin/python"
}

Sorry if it is a naive question, I have just shifted to vs code from pycharm so I am getting bit of trouble with vs code.


Viewing all articles
Browse latest Browse all 97355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>