Dear all,
My apologies in advance for such a simple question, but I've spent hours browsing on the Net w/o obtaining a solution. I am newbie to Python and coding, and I am working on a project for my studies. I am using VSCode casue PyCharm is too heavy for my computer.
I have a project with the following structure:
Project
|_ database: __init__.py, connection.py
|_ recipes: __init__.py, recipe_modules.py, recipe_functions.py
|_ (other irrelevant packages)
The package recipe_modules.py has the following statements:
And when running the module I get the following error in VSCode:
I know is an issue with the configuration of VSCode but I have spent hours w/o being able to fix it
.
Btw, my file .vscode/launch.json already has the follwing code:
I am absolutely lost here, and this is killing me. Hopefully you have already faced this.
Thanks in advance for your help!
My apologies in advance for such a simple question, but I've spent hours browsing on the Net w/o obtaining a solution. I am newbie to Python and coding, and I am working on a project for my studies. I am using VSCode casue PyCharm is too heavy for my computer.
I have a project with the following structure:
Project
|_ database: __init__.py, connection.py
|_ recipes: __init__.py, recipe_modules.py, recipe_functions.py
|_ (other irrelevant packages)
The package recipe_modules.py has the following statements:
1 2 3 |
import peewee import datetime from database.connection import BaseModel, db |
Error:ModuleNotFoundError: No module named 'database'
However, when I run the module in PyCharm I do not get any error - meaning the statements are correctly defined and all the rest is OK.I know is an issue with the configuration of VSCode but I have spent hours w/o being able to fix it

Btw, my file .vscode/launch.json already has the follwing code:
1 2 3 4 5 |
{ "env" : { "PYTHONPATH" : "${workspaceFolder}" } { |
Thanks in advance for your help!