我正在尝试让gitzilla在带有python 2.7.6和git 1.9.1的ubuntu 14.04上为我工作。这是我第一次使用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"
你有什么办法让它工作吗?
发布于 2017-06-05 08:23:17
Alexander的评论指出了这个问题(大约在3年前),这导致了对这个问题的评论中显示的答案。正如评论中所看到的,它是python2.7和python3包的混合。如果你来这里是为了解决gitzilla同样的实际问题,补丁现在已经被输入到主分支中,所以请使用最近的版本或我在上面的评论中链接到的版本。
我添加了这个来结束问题,以停止垃圾答案。
发布于 2017-02-22 12:44:46
使用pip install cookiejar安装cookiejar
https://stackoverflow.com/questions/27139562
复制相似问题