I downloaded the source of Android, but when I used repo init according to the website, I got the following error:
Traceback (most recent call last):
File "/root/bin/repo", line 91, in <module>
import readline
ImportError: No module named readline
I am using Ubuntu 10.04 and Python 2.7.2
AFAIK, the default Python environment in Ubuntu 10.04 is Python 2.6.5, so you must be using a self-compiled python.
You should be missing some readline header files when building your python 2.7.2, so you have two choices now:
pip install readline or easy_install readlineI have the same issue, and I fixed it in this way, hope it will be helpful to you.
$ source Install_Python2.7.5.sh
Shell script "Install_Python2.7.5.sh" is like this:
#!/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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With