我已經在我的系統中爲python2.6.6安裝了argpath包。但是當我嘗試運行需要argparser模塊的腳本時,仍然出現錯誤「ImportError:No module named argparse」Python - 安裝Argpath for python 2.6.6版本中的問題版本
我使用的是Fedora 20,所以默認版本是Python 2.7。因此,我已以一些其它路徑(別名蟒=「的/ usr/local/bin中/ python2.6的」)安裝蟒2.6和我已經安裝argparser使用PIP工具,如下所示,並將其所述「安裝成功」
[[email protected] python2.6]# pip install --target=/usr/bin/Python2.6/lib/python2.6/ argparse
Downloading/unpacking argparse
Downloading argparse-1.2.1.tar.gz (69kB): 69kB downloaded
Running setup.py egg_info for package argparse
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.orig' found anywhere in distribution
warning: no previously-included files matching '*.rej' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Installing collected packages: argparse
Running setup.py install for argparse
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.orig' found anywhere in distribution
warning: no previously-included files matching '*.rej' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Successfully installed
argparse
Cleaning up...
但是,當我嘗試運行我的python腳本,它仍然說着同樣的錯誤如下
[[email protected] python2.6]# python /home/rajamm/python_scripts/json2csv.py -f /home/rajamm/python_scripts/cvl.json -o /home/rajamm/python_scripts/cvl.csv
Exception in user code:
------------------------------------------------------------
Traceback (most recent call last):
File "/home/rajamm/python_scripts/json2csv.py", line 6, in <module>
import fileinput, argparse, json, csv
ImportError: No module named argparse
------------------------------------------------------------
Exiting1.
我已經被困2天這個問題。請在此建議我。