我使用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失敗的建築輪」。 –