Using pre-commit python script in PowerPC

Still need help?

The Atlassian Community is here for you.

Ask the community


The following appears in the terminal when the pre-commit python script is used in command line.

./ <review-key>
Traceback (most recent call last):
File "./", line 12, in <module>
import argparse
ImportError: No module named argparse


This happens if you are using python < 2.7 and/or the argparse modules are not installed.


  • Download Python 2.7 packages found here for Debian or directly from 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
# 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.
sudo python2.7
sudo easy_install-2.7 virtualenv

# Installing pip
tar xzf pip-0.7.2.tar.gz
cd pip-0.7.2
sudo python install
# Installing argparse modules
pip install argparse

Last modified on Apr 1, 2016

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.