zoukankan      html  css  js  c++  java
  • vscode自定义的模块,在不同目录调用时,一直报错"No module named 'xxx' "

    从pycharm换到vscode,被一个错误纠结好久,就是自定义的模块,在不同目录相互调用时,一直报错"No module named 'xxx' "

    查了好多资料,一直没解决,最后发现,为什么pycharm可以,但vs code不行,主要是因为pycharm创建时会创建__init__.py文件,所以调用不报错,在vscode文件夹下创建__init__.py就不会报错了

    还要更改:

    {
    // 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",
    "type": "python",
    "request": "launch",
    "stopOnEntry": false,
    "pythonPath": "${command:python.interpreterPath}",
    "program": "${file}",
    "cwd": "${workspaceRoot}",
    "env": {"PYTHONPATH":"${workspaceRoot}"},
    "envFile": "${workspaceRoot}/.env"
    }
    ]
    }
  • 相关阅读:
    perl6中函数参数(2)
    perl6中函数参数(1)
    上传绕过(转载)
    perl6中的hash定义(1)
    mssql手工注入2
    mssql手工注入1
    mssql注入中的储存用法删除与恢复
    perl 复制exe文件的简单方法
    python shell
    perl中设置POST登录时的重定向
  • 原文地址:https://www.cnblogs.com/zhifeiji822/p/13440586.html
Copyright © 2011-2022 走看看