Paramiko module not found

时光总嘲笑我的痴心妄想 提交于 2021-02-05 11:27:07

问题


When I try to import paramiko, when I try to run rforward.py from the paramiko demo files, it shows error :

./rforward.py
Traceback (most recent call last):
  File "./rforward.py", line 36, in <module>
    import paramiko
ImportError: No module named paramiko

And when I try to install paramiko via pip,

pip install paramiko

It shows :

Requirement already satisfied: paramiko in /usr/lib/python3/dist-packages (2.6.0)

My python version is 2.7.18. I had installed paramiko for a different python3 program using pip3 install paramiko Will completely removing it and re-installing it with pip instead of pip3 help? Will this loose the module from python3
EDIT :

python --version
Python 2.7.18
find /usr/lib/python3/dist-packages -iname "*paramiko*"

/usr/lib/python3/dist-packages/paramiko
/usr/lib/python3/dist-packages/paramiko-2.6.0.egg-info

Any suggestions please? Thanks in advance


回答1:


Issue was with pip. The pip and pip3 I had installed in the same path, /usr/lib/python3/dist-packages. I installed a pip specifically for python 2.7. Using this. Now pip installs for python and pip3 for python3.



来源:https://stackoverflow.com/questions/62258110/paramiko-module-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!