ubuntu1204 import paramiko遇到:ImportError,输出如下:
Python 2.7.3 (default, Oct 26 2016, 21:04:23)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/paramiko/__init__.py", line 22, in <module>
from paramiko.transport import SecurityOptions, Transport
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 89, in <module>
from paramiko.dsskey import DSSKey
File "/usr/local/lib/python2.7/dist-packages/paramiko/dsskey.py", line 27, in <module>
from cryptography.hazmat.primitives.asymmetric.utils import (
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/asymmetric/utils.py", line 7, in <module>
from asn1crypto.algos import DSASignature
ImportError: No module named asn1crypto.algos
之后操作:
apt-get autoremove python-paramiko
rm -r /usr/local/lib/python2.7/dist-packages/paramiko
apt-get install python-paramiko
后解决