I installed PyCrypto and Paramiko (in their respective directories) with
python3 setup.py install
and both were installed successfully. However, when I try
import paramiko
in the 3.2.5 interpreter, I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/paramiko/__init__.py", line 64, in <module>
from transport import SecurityOptions, Transport
ImportError: No module named transport
I have no idea why it's doing this, as I checked in the folder and the transport.py
module is there. Why is there then an ImportError
?
It appears Paramiko is trying a relative import, which is not recognised in this form in Python 3 anymore. See the changes in Python 3. The import statements in Paramiko should be one of
(note the leading dot), or
You can either fix the paramiko source code, or as a workaround, you could add
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/paramiko
to yourPYTHONPATH
. Neither are preferred.Did you run the
2to3
tool before you ranpython3 setup.py install
? I'm not sure if that would fix this though, since the tool probably can't distinguish between a relative or absolute import in the way it is used here.Do check on the Paramiko forums (if there are) and file a bug against Paramiko for Python 3 compatibility.
Edit
It appears you already did file a bug report.