我试图让 gitzilla 在 ubuntu 14.04 上使用 python 2.7.6 和 git 1.9.1 为我工作。这是我第一次使用 python 或 gitzilla。
安装 gitzilla 并为 git 钩子添加符号链接后,推送更改会产生以下输出:
geoff@jenkins:~/Example$ git push origin master
Counting objects: 5, done.
Writing objects: 100% (3/3), 282 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Traceback (most recent call last):
remote: File "hooks/update", line 9, in <module>
remote: load_entry_point('gitzilla==2.0', 'console_scripts', 'gitzilla-update')()
remote: File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
remote: return get_distribution(dist).load_entry_point(group, name)
remote: File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
remote: return ep.load()
remote: File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
remote: entry = __import__(self.module_name, globals(),globals(), ['__name__'])
remote: File "build/bdist.linux-x86_64/egg/gitzilla/hookscripts.py", line 11, in <module>
remote: File "build/bdist.linux-x86_64/egg/gitzilla/hooks.py", line 9, in <module>
remote: File "build/bdist.linux-x86_64/egg/gitzilla/utils.py", line 10, in <module>
remote: File "/usr/local/lib/python2.7/dist-packages/bugz/bugzilla.py", line 7, in <module>
remote: import http.cookiejar
remote: ImportError: No module named http.cookiejar
remote: error: hook declined to update refs/heads/master
To /home/geoff/gitrepos/Example.git/
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '/home/geoff/gitrepos/Example.git/'
由此我认为我需要安装 http.cookiejar(或 cookielib),但我不知道如何获取它。
我试过没有成功:
pip install http.cookiejar
和
pip install cookielib
两次 pip 都抱怨没有找到任何东西,但后来我尝试pip install cookiejar
了确实安装它,但我仍然得到相同的错误 pip install cookiejar
现在这个运行没有抱怨:python -c "import cookiejar"
这抱怨找不到模块:python -c "import http.cookiejar"
任何想法如何让这个工作?