【问题标题】:ezyang / git-ftp on WindowsWindows 上的 ezyang / git-ftp
【发布时间】:2011-06-24 20:30:32
【问题描述】:

我一直在尝试在我的 Windows 上安装来自 https://github.com/ezyang/git-ftp 的 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模块在哪里?

【问题讨论】:

    标签: python windows git git-ftp


    【解决方案1】:

    git-ftp 是用 Python 2 编写的,目前与 Python 3 不兼容。请安装早期版本的解释器。

    编辑。您需要安装 git-python 库。由于安装库的最简单方法是easy_install,因此您应该按照此处的说明进行设置:http://pypi.python.org/pypi/setuptools,然后运行easy_install git-python

    【讨论】:

    • 我也试过 python-2.7.2.amd64-pdb 但它似乎没有用。它在第 42 行失败(3.2 在第 322 行失败)。请参阅我的编辑:了解更多信息。
    • git-ftp 好像是针对python 3的,所以看不懂旧的print complaint指令
    • 不,它使用 git- python 3,它是一个库,而不是 Python 3,它是一种语言。
    • 有没有办法在 Windows 上安装 git-python 3 而无需使用 easy_install 或任何其他需要 cygwin 的工具?我做了一些研究,但我找不到任何东西。
    • 我不知道...坦率地说,你是我的第一个 Windows 用户。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-10
    • 2012-12-20
    • 1970-01-01
    • 1970-01-01
    • 2011-07-05
    • 1970-01-01
    相关资源
    最近更新 更多