I get this error running a Flask app out of Visual Studio Code (VS Code):
*Serving Flask APP "myWebSite.py"
*Environment: production WARNING:
Do not use the development server in a production environment. Use a production WSGI server instead.
- Debug mode:off Useage: flask run [OPTIONS]
Error: Could not import "myWebSite"
When I run it out of another PC with Visual Studio Code it runs fine. What could it be?
You will want to check you have all the requirements installed using pip.
Then the trick is you need to select the correct debugger in Visual Studio Code:
Python: Current File (Integrated Terminal)
If you have another selected such as Python: Flask it causes the error.
Another way is right click on the contents of myWebSite.py and Python Run in Terminal
.