zoukankan      html  css  js  c++  java
  • vscode中调试python,找不到程序当前目录的包

    module not found error, how python interpreter find modules:

    • The directory from which the input script was run, or the current directory if the interpreter is being run interactively
    • The list of directories contained in the PYTHONPATH environment variable, if it is set. (The format for PYTHONPATH is OS-dependent but should mimic the PATH environment variable.)
    • An installation-dependent list of directories configured at the time Python is installed

    change "cwd" option in vscode's launch.json: (设置为要运行的python脚本的目录)

    "cwd":"${workspaceFolder}/tasks/human_pose", 
     
    how to launch the python program in vscode with new system Terminal: (在新的系统终端中运行,而不是VS code内置终端)
    set "console" to  "console": "externalTerminal"
     
    in C++'s launch.json, it should be : 
    "externalConsole": true,

    ref:

    https://realpython.com/lessons/module-search-path/

    https://code.visualstudio.com/docs/python/debugging#_set-configuration-options

    https://code.visualstudio.com/docs/cpp/launch-json-reference

  • 相关阅读:
    Mysql配置文件解析
    Mysql的视图
    Setup和 Hold
    洛谷 P2257
    洛谷 P3455
    洛谷 P1447
    洛谷 P1155
    洛谷 P1262
    洛谷 P4180
    洛谷 P5540
  • 原文地址:https://www.cnblogs.com/mrlonely2018/p/14950931.html
Copyright © 2011-2022 走看看