2017-07-29 91 views
1

我使用pip安装了parallel-ssh(我不是为Python 2.7安装它,它不是为Python 3安装吗?),然后我尝试导入IDLE到使用。我正在关注在线文档的快速入门指南。它给了我一个错误,说有没有名为gevent的模块。并行SSH - 没有模块命名为gevent错误

下面是完整的错误:

Traceback (most recent call last): 
    File "/home/pi/test.py", line 1, in <module> 
    from pssh.pssh_client import ParallelSSHClient 
    File "/usr/local/lib/python2.7/dist-packages/pssh/__init__.py", line 38, in <module> 
    from .pssh_client import ParallelSSHClient 
    File "/usr/local/lib/python2.7/dist-packages/pssh/pssh_client.py", line 24, in <module> 
    from gevent import monkey # noqa: E402 
ImportError: No module named gevent 

从文档,它说

ParallelSSH uses gevent’s monkey patching to enable asynchronous use of the Python standard library’s network I/O.

Make sure that ParallelSSH imports come before any other imports in your code. Otherwise, patching may not be done before the standard library is loaded which will then cause ParallelSSH to block.

If you are seeing messages like This operation would block forever, this is the cause.

这是我导入的第一件事情,所以我不知道为什么它给了一个错误。有人可以帮我吗?谢谢。

+0

使用pip安装gevent,当我试图安装Paramiko –

+0

@AdriánKálazi时,我也遇到了这个问题我尝试安装gevent,但它给了我一个错误,说“gevent失败的建筑轮”。 –

回答

0

如果你安装了Python 2.7的模块,那么它不会在你的Python 3解释器中工作。如果Python 2.7版是默认的解释器,你应该只需要使用Python 3命令

你可能跑这条命令来安装模块调用PIP命令:

[[email protected]] python -m pip install <module> 
>> Requirement already satisfied: <module> in /Library/Python/2.7/site-packages 

试试这个命令:

[[email protected]] python3 -m pip install <module> 
>> Requirement already satisfied: <module> in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages 
+0

如果我的Python安装属于操作系统,是否会出现问题?安装需要很长时间,我取消了手术,因为我不想再继续。 –

0

看起来不像gevent安装已完成。

尝试:

pip install -U pip 
pip install -U setuptools 
pip install -U parallel-ssh 

为了能够安装二进制轮,双方GEVENT和并行-SSH,使用PIP/setuptools的需要进行升级。

从源代码构建需要编译器和头文件,您可能没有。

相关问题