我已经在我的系统中为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天这个问题。请在此建议我。