【发布时间】:2021-01-06 04:06:09
【问题描述】:
我正在运行macOS 版本11.0.1。
我正在尝试导入一个名为 troposphere 的模块
我安装了Python2.7 和Python3.9.1
当我尝试使用Python2.7 导入对流层时,就像
#!/usr/bin/python
from troposphere import Template
确实有效。但是当我尝试使用 Python3.9.1 导入相同的内容时,就像
#!/usr/bin/python3
from troposphere import Template
它会抛出这样的错误
ModuleNotFoundError: No module named 'troposphere'
我该怎么办?请帮忙
【问题讨论】:
-
你是怎么安装的?
-
我尝试通过 pip3 和 pip 安装。问题仍然存在,不知道为什么
-
尝试卸载它并运行该评论中提到的命令。但是说
Requirement already satisfied: troposphere in /usr/local/lib/python3.9/site-packages (1.8.2) -
那么,你确定
/usr/bin/python3是 Python 3.9.1 吗?
标签: python python-3.x amazon-web-services troposphere