python - Visual Studio ImportError: No module named boto3
问题描述
I am trying to run VS-Code to work with Python and boto3. but I am getting the following error
importError: No module named boto3
I am able to run python statements via VS-code but for some reason I can't get it to work with AWS.
VS-Code Extension:
AWS Toolkit
Code Runner
Python
MacOS CLI
python3 --version
Python 3.7.4
aws --version
aws-cli/1.16.209 Python/3.7.4 Darwin/18.0.0 botocore/1.12.199
pip3 --version
pip 19.2.1
VS-Code launch.json
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
解决方案
Solution:
I opened a Terminal from the top menu (Terminal -> New Terminal);
in the newly opened terminal I typed:
pip install botocore
pip install boto3
After doing this, the errors I was getting for:
import boto3
from botocore.exceptions import ClientError
disappeared (after closing and reopening the Python file I was editing).
Background:
I am new to VisualStudio Code (Version: 1.41.1 on MacOS Mojave 10.14.6) and I was having the same problem.
推荐阅读
- javascript - Postman Express.js 响应正文始终为空
- laravel - 使用 laravel 6 编译材料设计时出错
- python - 零除法错误
- windows - NSIS MUI_WELCOMEFINISHPAGE_BITMAP 未在 Windows 10 上显示
- wordpress - 如何在类别页面上显示子类别列表?
- kubernetes - Kubernetes:如何配置/实现 HPA 以使用 CPU 进行扩展
- python-3.x - 在 openpyxl 折线图中显示隐藏的行
- python - Tkinter:如何检查条目小部件中的用户输入是否与数据库中的某些信息匹配
- java - Mongo 两个字符串的总和
- wix - Wix 工具集 - 为什么第二个自定义操作不在安装时运行?