Using pre-commit python script in PowerPC

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

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

原因

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 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

最終更新日 2016 年 4 月 1 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.