2015-12-16 115 views
0

我想在Python 3.5中使用paramiko进行SFTP文件传输。我知道paramiko依赖于PyCrypto并阅读了Python 3.5中的PyCrypto安装问题。尽管我已经看到了许多关于这个主题的问题,但我还没有找到在Python 3.5中成功实现SFTP文件传输的解决方案。Python 3.5 SFTP文件传输

我的第一个问题:是否可以使用Python 3.5进行SFTP文件传输?如果是这样,paramiko会工作吗?如果上述方法可行,为什么我在尝试安装PyCrypto时收到以下错误?

error: [WinError 2] The system canot find the file specified 
**Failed building wheel for pycrypto** 


我的第二个问题:如果的paramiko不会使用Python 3.5的工作,是否有任何的替代品或我必须恢复到以前的Python版本的SFTP文件传输?

+0

如果你只需要从A传输到B,'rsync'? – taesu

+0

rsync将无法正常工作,这必须通过sftp – ProgrammingWithRandy

+2

完成相关:http://stackoverflow.com/questions/32800336/pycrypto-on-python-3-5 –

回答

0

解决方案是在我的Linux服务器上安装Python 3.5.1,然后从那里安装pip install paramiko。我仍然不确定为什么PyCrypto无法安装在Windows 3.5的Python 3.5中,但这是我能够找到的唯一解决方案。

0

您可以安装PyCrypto二进制文件的Python 3.5,如果你没有安装C++编译器(即PIP需要使用编译这个库)

从这个网站安装PyCrypto二进制: https://github.com/sfbahr/PyCrypto-Wheels

做到这一点,最好的办法是:

64位的Python

C:\ Python35 \脚本\ pip.exe安装--use轮--no指数--find链接= https://github.com/sfbahr/PyCrypto-Wheels/raw/master/pycrypto-2.6.1-cp35-none-win_amd64.whl pycrypto

32位的Python

C:\ Python35 \脚本\ pip.exe安装--use轮--no指数--find链接= https://github.com/sfbahr/PyCrypto-Wheels/raw/master/pycrypto-2.6.1-cp35-none-win32.whl pycrypto

通过你的Python PIP路径\ Python35 \脚本\ pip.exe

要知道你的Python版本,运行python,并期待在括号中显示的架构:

当然更换ç

C:\ Users \ utilisateur> python

Python 3.5.1 | Anaconda 4.0.0(64-bit)| (默认,2016年2月16日,09:49:46)[MSC v.1900 64位AMD64)] on win32 输入“help”,“copyright”,“credits”或“license”以获取更多信息。

希望这可以帮助。