Repo导入readline错误

时间:2011-07-26 14:52:55

标签: android ubuntu repository

我已按照http://source.android.com/source/downloading.html中的说明尝试使用Android,但是当我使用repo时,我遇到了这个错误:
 导入readline ImportError:没有名为readline的模块

我使用的是Ubuntu 11.04和Python 2.7。

如果有人能帮助我,我将不胜感激。

2 个答案:

答案 0 :(得分:0)

尝试安装libreadline5-dev

答案 1 :(得分:0)

由于安装了readline模块的python,因此readline不可用。您需要重新编译包含readline的Python。你可以这样做,祝你好运!

$ source Install_Python2.7.5.sh

Shell脚本" Install_Python2.7.5.sh"是这样的:

#!/bin/bash

sudo apt-get install libreadline-dev

sudo aptitude install build-essential libreadline5-dev

sudo apt-get install libbz2-dev

if [ ! -d ~/software/Python/Python-2.7.5 ]; then

    mkdir ~/software
    mkdir ~/software/Python
    mkdir ~/software/Python/Python-2.7.5
fi

if [ ! -d ~/bin ]; then

    mkdir ~/bin
fi

user_root=~

echo $user_root

echo "unpackage Python-2.7.5.tar.bz2..."

tar -jxvf Python-2.7.5.tar.bz2 

echo "prepear to install Python-2.7.5"

cd Python-2.7.5

sed -i "s/#readline/readline/g" Modules/Setup.dist

echo "Start to install Python-2.7.5"

./configure --prefix=$user_root/software/Python/Python-2.7.5/  && make && make install

echo "Make symbol link"

ln -s -f $user_root/software/Python/Python-2.7.5/bin/* $user_root/bin

echo "Set environment variable"

PATH=$user_root/bin:$PATH