代码之家  ›  专栏  ›  技术社区  ›  Frank V

在Ubuntu Linux上构建Mercurial 1.3.1

  •  6
  • Frank V  · 技术社区  · 15 年前

    我正在尝试构建mercurial 1.3.1。到目前为止,我已经在我的MacOSX机器和我正在运行的LinuxUbuntu虚拟机上尝试了这一点。

    error: Python.h: No such file or directory 快结束了。我已经包括了所有的结果,以防这有助于某人排除故障。

    frank@ubuntu:~/Desktop/mercurial-1.3.1$ sudo make install
    [sudo] password for frank: 
    python setup.py  build
    running build
    running build_py
    creating build
    creating build/lib.linux-i686-2.6
    creating build/lib.linux-i686-2.6/mercurial
    copying mercurial/dirstate.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/bundlerepo.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/subrepo.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/httprepo.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/__version__.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/changelog.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/repo.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/config.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/byterange.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/verify.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/encoding.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/keepalive.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/sshserver.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/fancyopts.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/__init__.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/merge.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/i18n.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/archival.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/match.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/mail.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/help.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/win32.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/posix.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/repair.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/dispatch.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/error.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/templatefilters.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/localrepo.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/sshrepo.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/node.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/templater.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/streamclone.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/context.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/strutil.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/ignore.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/hook.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/mdiff.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/ui.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/lsprofcalltree.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/transaction.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/commands.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/windows.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/revlog.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/store.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/lock.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/changegroup.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/lsprof.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/manifest.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/url.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/util.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/demandimport.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/graphmod.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/statichttprepo.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/cmdutil.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/extensions.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/filemerge.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/hg.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/filelog.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/copies.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/hbisect.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/patch.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/ancestor.py -> build/lib.linux-i686-2.6/mercurial
    copying mercurial/simplemerge.py -> build/lib.linux-i686-2.6/mercurial
    creating build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/webutil.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/request.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/wsgicgi.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/protocol.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/server.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/__init__.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/common.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/hgwebdir_mod.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/webcommands.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    copying mercurial/hgweb/hgweb_mod.py -> build/lib.linux-i686-2.6/mercurial/hgweb
    creating build/lib.linux-i686-2.6/hgext
    copying hgext/pager.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/purge.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/graphlog.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/win32text.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/gpg.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/hgk.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/color.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/bugzilla.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/bookmarks.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/__init__.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/notify.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/record.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/interhg.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/rebase.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/churn.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/keyword.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/mq.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/transplant.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/acl.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/children.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/fetch.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/extdiff.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/win32mbcs.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/share.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/parentrevspec.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/hgcia.py -> build/lib.linux-i686-2.6/hgext
    copying hgext/patchbomb.py -> build/lib.linux-i686-2.6/hgext
    creating build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/bzr.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/convcmd.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/gnuarch.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/cvsps.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/__init__.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/git.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/p4.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/subversion.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/transport.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/common.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/hg.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/monotone.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/cvs.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/filemap.py -> build/lib.linux-i686-2.6/hgext/convert
    copying hgext/convert/darcs.py -> build/lib.linux-i686-2.6/hgext/convert
    creating build/lib.linux-i686-2.6/hgext/highlight
    copying hgext/highlight/highlight.py -> build/lib.linux-i686-2.6/hgext/highlight
    copying hgext/highlight/__init__.py -> build/lib.linux-i686-2.6/hgext/highlight
    creating build/lib.linux-i686-2.6/hgext/zeroconf
    copying hgext/zeroconf/__init__.py -> build/lib.linux-i686-2.6/hgext/zeroconf
    copying hgext/zeroconf/Zeroconf.py -> build/lib.linux-i686-2.6/hgext/zeroconf
    creating build/lib.linux-i686-2.6/hgext/inotify
    copying hgext/inotify/server.py -> build/lib.linux-i686-2.6/hgext/inotify
    copying hgext/inotify/__init__.py -> build/lib.linux-i686-2.6/hgext/inotify
    copying hgext/inotify/common.py -> build/lib.linux-i686-2.6/hgext/inotify
    copying hgext/inotify/client.py -> build/lib.linux-i686-2.6/hgext/inotify
    creating build/lib.linux-i686-2.6/hgext/inotify/linux
    copying hgext/inotify/linux/__init__.py -> build/lib.linux-i686-2.6/hgext/inotify/linux
    copying hgext/inotify/linux/watcher.py -> build/lib.linux-i686-2.6/hgext/inotify/linux
    running build_ext
    building 'mercurial.base85' extension
    creating build/temp.linux-i686-2.6
    creating build/temp.linux-i686-2.6/mercurial
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c mercurial/base85.c -o build/temp.linux-i686-2.6/mercurial/base85.o
    mercurial/base85.c:12:20: error: Python.h: No such file or directory
    mercurial/base85.c: In function ‘b85prep’:
    mercurial/base85.c:23: warning: implicit declaration of function ‘memset’
    mercurial/base85.c:23: warning: incompatible implicit declaration of built-in function ‘memset’
    mercurial/base85.c: At top level:
    mercurial/base85.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    mercurial/base85.c:76: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    mercurial/base85.c:141: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘methods’
    mercurial/base85.c:150: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initbase85’
    error: command 'gcc' failed with exit status 1
    make: *** [build] Error 1
    
    3 回复  |  直到 15 年前
        1
  •  12
  •   Jonathan Holloway    15 年前

    apt-get install python-dev
    
        2
  •  2
  •   Steve Losh    15 年前

    谷歌的第一个结果: http://ubuntuforums.org/showthread.php?t=497109

    这有用吗?

    编辑:这是针对Linux的。我非常肯定,只有在安装了开发人员工具的情况下,才会在OSX上安装Python.h。你安装了吗?

        3
  •  2
  •   Dave Everitt    15 年前

    Setuptools ):

    sudo easy_install mercurial
    

    /Library/Frameworks/Python.framework/Versions/2.6/bin/
    

    我运行Python2.6(在MacOS10.4.11上),因此这也解决了问题 Mercurial OS X installer package (截至2009年7月25日仅为1.2.1)关于需要Python 2.5的投诉。