小编eze*_*niv的帖子

与 Poetry 一起安装的软件包无法导入

有一个简单但令人困惑的问题:当我尝试在模块中使用我用诗歌添加的包时,它无法导入。采取的步骤:

  1. poetry add sendgrid
  2. 在一个模块中,import sendgrid
  3. 错误: Import "sendgrid" could not be resolved PylancereportMissingImports

我尝试过的故障排除:

  • 我检查了我的项目的诗歌 venv 目录,sendgrid 就在那里:'C:\\Users\\xyz123\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\nameofproject-py3.10\\lib\\site-packages'
  • 还检查了 sys.path(); 列出了该站点包目录的路径
  • 跑步poetry install给了我回应No dependencies to install or update
  • pyproject.toml 和诗歌.lock 文件都列出了 sendgrid

到底是怎么回事?

python python-poetry

5
推荐指数
1
解决办法
9320
查看次数

当函数采用包含等号 = 符号的参数时,这意味着什么?

我的函数在类中定义,将一个对象作为参数。对象后面有一个等号,仍然在函数参数定义中。我以前没有遇到过,这是什么意思?如果没有传递电子邮件密钥/对象对,它是否默认传递一个空对象?

class UserAPI extends DataSource {

   async createUser({ email: emailArg } = {}) { 
      ...function goes here...          ^^^^
   }
}
Run Code Online (Sandbox Code Playgroud)

javascript function

0
推荐指数
1
解决办法
27
查看次数

标签 统计

function ×1

javascript ×1

python ×1

python-poetry ×1