Это все под CentOS 7. Я установил python 2.7.16 в / usr / local / bin и создал вариант pip2.7
wget https://bootstrap.pypa.io/get-pip.py
python2.7 get-pip.py
pip2.7 install paramiko
Я возвращаюсь из pip:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: paramiko in /usr/lib/python2.7/site-packages (2.6.0)
Requirement already satisfied: bcrypt>=3.1.3 in /usr/lib64/python2.7/site-packages (from paramiko)
(3.1.7)
Requirement already satisfied: pynacl>=1.0.1 in /usr/lib64/python2.7/site-packages (from paramiko)
(1.3.0)
Requirement already satisfied: cryptography>=2.5 in /usr/lib64/python2.7/site-packages (from
paramiko) (2.7)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python2.7/site-packages (from bcrypt>=3.1.3-
>paramiko) (1.9.0)
Requirement already satisfied: cffi>=1.1 in /usr/lib64/python2.7/site-packages (from bcrypt>=3.1.3-
>paramiko) (1.12.3)
Requirement already satisfied: ipaddress; python_version < "3" in /usr/lib/python2.7/site-packages
(from cryptography>=2.5->paramiko) (1.0.22)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/lib/python2.7/site-packages (from
cryptography>=2.5->paramiko) (0.24.0)
Requirement already satisfied: enum34; python_version < "3" in /usr/lib/python2.7/site-packages (from
cryptography>=2.5->paramiko) (1.1.6)
Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi>=1.1-
>bcrypt>=3.1.3->paramiko) (2.19)
echo $ PATH дает:
/usr/local/lib/python2.7:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:
/home/metavqmlinuxadmin/.local/bin:/home/metavqmlinuxadmin/bin:/usr/local/lib/python2.7:
/usr/local/lib/python2.7/site-packages
Запуск python2 .7 и попытка импортировать paramiko:
$ python2.7
Python 2.7.16 (default, Mar 19 2020, 18:45:12)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named paramiko
FWIW, есть подкаталог paramiko и содержимое в /usr/lib/python2.7/site-packages