我查遍了互联网并花了几个小时试图解决这个问题。这可能是一件非常简单的事情,所以请放宽我的要求。这是我第一次使用 Visual Studio Code。我已经尝试过以下链接中提供的解决方案:
我正在尝试运行 urls.py 文件,该文件尝试使用 - 导入视图文件
from . import views
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
回溯(最近一次调用最后一次):文件“c:/Users/abc/projects/telusko/calc/urls.py”,第 7 行,来自 . 导入视图导入错误:无法导入名称“视图”
我已经尝试了所有可能的组合,目前我的 launch.json 文件如下所示:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}],
"env": {"PYTHONPATH": "c:/Users/abc/projects/telusko/"}, …
Run Code Online (Sandbox Code Playgroud)