我使用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.
这是我导入的第一件事情,所以我不知道为什么它给了一个错误。有人可以帮我吗?谢谢。
使用pip安装gevent,当我试图安装Paramiko –
@AdriánKálazi时,我也遇到了这个问题我尝试安装gevent,但它给了我一个错误,说“gevent失败的建筑轮”。 –