Я установил пакет argpath для python2.6.6 в своей системе. Но когда я пытаюсь запустить свой скрипт, для которого требуется модуль argparser, все равно выдает ошибку «ImportError: нет модуля с именем argparse».
я использую Fedora 20, поэтому версия по умолчанию — Python 2.7. Итак, я установил python 2.6 по другому пути (псевдоним python='/usr/local/bin/python2.6'), и я установил argparser с помощью инструмента pip, как показано ниже, и он сказал: «Успешно установлено»
[root@127 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, он все еще говорит ту же ошибку, что и ниже.
[root@127 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 дня с этой проблемой. Пожалуйста, предложите мне это.