當前位置: 首頁>>技術教程>>正文


installation – 在Ubuntu 10.04上安裝Mercurial 1.5.4

, ,

問題描述

我已經下載了源代碼並嘗試通過README說明進行安裝:

sudo make install

但出現以下錯誤:

python setup.py  build
running build
running build_mo
warning: hgbuildmo: could not find msgfmt executable, no translations will be built
running build_py
running build_ext
building 'mercurial.base85' extension
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-x86_64-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:147: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘methods’
mercurial/base85.c:156: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initbase85’
error: command 'gcc' failed with exit status 1
make: *** [build] Error 1

請記住,我知道我可以使用以下方法安裝:

sudo apt-get install mercurial

但這給了我一個舊版本(1.4.3-1)。

發生什麽了?

最佳方法

從該行:

mercurial/base85.c:12:20: error: Python.h: No such file or directory

似乎您沒有python的開發工具。解決:

sudo apt-get install python-dev

次佳方法

您無需手動構建Mercurial即可在Ubuntu上獲得最新版本。 https://launchpad.net/~mercurial-ppa/+archive/releases處有一個PPA存儲庫

sudo add-apt-repository ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install mercurial

順便說說。還有一個用於TortoiseHG的PPA,它在Nautilus中提供了很好的Mercurial功能集成:https://launchpad.net/~tortoisehg-ppa/+archive/releases

sudo add-apt-repository ppa:tortoisehg-ppa/releases
sudo apt-get update
sudo apt-get install tortoisehg-nautilus

參考資料

本文由Ubuntu問答整理, 博文地址: https://ubuntuqa.com/zh-tw/article/10324.html,未經允許,請勿轉載。