Search code examples
pythonpython-3.xlinuxsshparamiko

Paramiko module not found


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


Solution

  • 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.