ezyang / Windows上的git-ftp
我一直在尝试在我的Windows上安装git-ftp,地址是https://github.com/ezyang/git-ftp。我知道大部分git-ftp需要cygwin,或者根本无法在Windows上安装,但因为它是用Python写的,而我可以在Windows上安装Python解释器,所以我觉得我可以安装它。
我安装了Python 3.2,并把它添加到了我的路径中。然后我拉取了git-ftp的最新版本,并按照安装说明进行操作,这些说明非常清晰:
Requirements: [git-python 3.x] ( http://gitorious.org/git-python )
it can be installed with `easy_install gitpython`
Usage: `python git-ftp.py`
接着我运行了'python git-ftp.py',结果出现了以下错误:
python git-ftp.py install
File "git-ftp.py", line 322
print complaint
^
SynthaxError: invalid synthax
我想问的是:为什么它不工作?是Python的问题,还是git-ftp脚本的问题,或者是Windows兼容性的问题?注意:我没有安装'easy_install gitpython',我真的需要它吗?
编辑:
我还尝试安装了python-2.7.2.amd64-pdb,然后运行同样的命令,结果又出现了一个错误:
python git-ftp.py install
Traceback (most recent call last):
File "git-ftp.py", line 48, in <module>
from git import Tree, Blob, Repo, Git, Submodule
ImportError : No module named git
我认为这是因为脚本找不到我的git或者类似的问题。于是我尝试把正确的'ftpdata'文件放到一个.git文件夹里,并从.git的根文件夹运行脚本,甚至尝试直接从.git文件夹运行。这也没有成功。
我不知道这是否重要,但我使用的是Windows 7 - 64位(Intel Core2 Duo CPU T9600)。
我想问的是:如何告诉Python脚本git模块在哪里?
1 个回答
git-ftp 是用 Python 2 写的,目前不支持 Python 3。所以你需要安装一个早期版本的 Python 解释器。
补充说明。 你还需要安装 git-python 这个库。安装库最简单的方法是用 easy_install
,你可以按照这里的说明进行设置:http://pypi.python.org/pypi/setuptools,然后运行 easy_install git-python
来安装。