2011-06-23 54 views
0

我想与同时使用的rsync超过SFTP和WebDAV文件传输一个Python模块开发蟒蛇。 我找到了一个叫LIB pysync(和其他人最终)。但是我在Windows 7上。我使用VisualStudio 2010,但由于“问题”,构建失败。Windows 7和使用rsync

所以我不知道是否有人知道在Windows,MacOS和Linux的工作librsync什么 - 因为我有这个跨平台的要求。

C:\Python27\Scripts>pip.exe install pysync 
    Downloading/unpacking pysync 
     Downloading pysync-2.24.tar.bz2 
     Running setup.py egg_info for package pysync 

     file librsync.py (for module librsync) not found 
     warning: no files found matching 'librsync_wrap.*' 
     warning: no files found matching 'librsync\COPYING' 
     warning: no files found matching 'librsync\*.h' 
     warning: no files found matching 'librsync\configure' 
     warning: no files found matching 'librsync\Makefile.in' 
     warning: no files found matching 'librsync\config.h.in' 
     warning: no files found matching 'librsync\config.guess' 
     warning: no files found matching 'librsync\config.sub' 
     warning: no files found matching 'librsync\install-sh' 
     warning: no files found matching 'librsync\popt\Makefile.in' 
    Installing collected packages: pysync 
     Running setup.py install for pysync 
     file librsync.py (for module librsync) not found 
     file librsync.py (for module librsync) not found 
     building 'md4' extension 
     C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\includ 
    e -IC:\Python27\PC /Tcmd4sum/md4module.c /Fobuild\temp.win32-2.7\Release\md4sum/md4module.obj 
     md4module.c 
     c:\python27\include\pyconfig.h(227) : fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory 
[...] 

    ---------------------------------------- 
    Command C:\Python27\python.exe -c "import setuptools;__file__='C:\\Python27\\Scripts\\build\\pysync\\setup.py';exec(compile(op 
    en(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\w 
    ishi\appdata\local\temp\pip-kvzhhk-record\install-record.txt failed with error code 1 
    Storing complete log in C:\Users\wishi\AppData\Roaming\pip\pip.log 

    C:\Python27\Scripts> 

回答

1

你真的被绑定到rsync?您正在使用SFTP传输文件,因此paramiko可以为你工作。如果你真的需要一个工作的librsync,你有几个选择。

  1. 搜索一个预编译的版本并安装(希望你的谷歌福强...)
  2. 安装cygwin,下载源代码,运行make安装,更改选项为Windows构建之后。
  3. 下载源到Linux操作系统中,并且将它设置交叉编译
  4. 使用getGnuWin32获得所有必要建库的工具,把它们放在你的路径,然后重新运行点子。它应该成功运行make命令来构建库...如果它能找到源代码。

所有这些事情(除了1)都需要这个库的来源,这只是做跨平台业务的一个代价。如果你不喜欢,有没有windows版本已经上市,那么rsync的可能不是你的工具。

最后,根据更新here,如果有人想Windows可执行文件,他们需要联系开发商,他会建立他们。