如何在不同版本的 python 上安装 python 模块

How do I install a python module on a different version of python

简而言之,我有 Python 3.5,但现在我还安装了 3.6。

我正在尝试这个:

pip3 安装 web3

这只为 Python 3.5(我以前的版本)安装 web3,我也想为 3.6 安装它吗?谢谢!

您的 pip3 中仍然有通往 Python 3.5 的路径,因此这就是 运行 的来源。您还可以 运行 pip 作为模块使用您想要的特定 Python。

python3.6 -m pip ...

或者,将 pip3 复制到 pip3.6,然后修改它以使用 python3.6.