visual-studio-code - 无法导入 'azure.functions' pylint(import-error) [3,1] 和无法导入 '__app__modules.library_finder' pylint(import-error) [4,1]

标签 visual-studio-code importerror pylint

我正在尝试在 Microsoft Azure 中测试无服务器 Python Chatbot API,但是当我按照在线指南进行操作时 https://towardsdatascience.com/creating-a-serverless-python-chatbot-api-in-microsoft-azure-from-scratch-in-9-easy-steps-2f1913fc9581
它给出了这些错误:
无法导入“azure.functions”pylint(导入错误)[3,1]
无法导入 '__app__modules.library_finder' pylint(import-error) [4,1]
知道如何解决这个问题吗?
问候

最佳答案

这个错误来自pylint。似乎 linter 没有指向 .env,因此无法验证 azure 包!要解决它,你可以试试这个:

在 Visual Studio 代码中:

  • 在状态栏中找到 Python 版本并点击它
  • 选择项目所在的 Azure 工作区
  • 为您显示 Python 版本列表。选择以 ./.venv/开头的那个(在我的例子中,它是:./.venv/bin/python)
  • 然后您可能会看到一个弹出窗口,提示未安装 Linter pylint。
  • 点击安装按钮安装它,你应该很高兴

  • 希望这可以帮助

    关于visual-studio-code - 无法导入 'azure.functions' pylint(import-error) [3,1] 和无法导入 '__app__modules.library_finder' pylint(import-error) [4,1],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60898533/

    相关文章:

    python - 使用 conda 环境在 VS code 中部署 Azure Functions

    vue.js - 如何在 Visual Studio Code 中自动完成 Vue 模板

    python - 找不到 pyodbc 模块

    python - Pylint 说 'string' 模块已弃用。获取小写字符范围的新方法是什么?

    python - Nose 工具和 pylint

    node.js - VS Code 中安装错误 - eslint

    typescript - tsserver : Error processing request (No Project)

    go - 导入本地源文件以兼容 Travis CI

    Python - 导入错误 : No module named foo. 栏

    python-3.x - 导入 functools 时,pylint 错误 'TreeRebuilder3k' 对象没有属性 'visit_joinedstr'