Using pre-commit python script in PowerPC
Problem
The following appears in the terminal when the pre-commit python script is used in command line.
./crucible.py <review-key>
Traceback (most recent call last):
File "./crucible.py", line 12, in <module>
import argparse
ImportError: No module named argparse
Cause
This happens if you are using python < 2.7 and/or the argparse modules are not installed.
Resolution
Download Python 2.7 packages found here for Debian or directly from python.org for other distributions and install them.
Installing manually:
# Unpacking the downloaded file
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
# Configuring installation prefix
./configure --prefix=/usr --enable-shared
# Making everything before install
make
# Installing
sudo make install
cd ..
# Changing python binary priorities
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
sudo update-alternatives --set python /usr/bin/python2.6
# Downloading and installing virtual environment.
wget http://peak.telecommunity.com/dist/ez_setup.py
sudo python2.7 ez_setup.py
sudo easy_install-2.7 virtualenv
# Installing pip
wget http://pypi.python.org/packages/source/p/pip/pip-0.7.2.tar.gz
tar xzf pip-0.7.2.tar.gz
cd pip-0.7.2
sudo python setup.py install
# Installing argparse modules
pip install argparse
Last modified on Apr 1, 2016
Powered by Confluence and Scroll Viewport.