为什么 Python3 找不到 Fabric?

Why can't Python3 find Fabric?

我在 Python 3.

中使用 Fabric 时遇到问题
$ pip list | grep fabric
fabric (2.4.0)

$ python3 -V
Python 3.7.1

$ python3
Python 3.7.1
>>> from fabric import Connection
Traceback...
ModuleNotFoundError: No module named 'fabric'

Fabric 文档说:

Fabric is a high level Python (2.7,3.4+) library...

Fabric 安装到仅包含 Python 2.7 的虚拟环境中。 Python 3 安装在该虚拟环境之外。这就是python3找不到面料包的原因吗?我的印象是,如果您激活虚拟环境,安装到 venv 中的所有包都可用于您执行的任何 Python 解释器。

您只需在您的环境中为 python3 安装 Fabric。 pip3 install fabric