所以,我认为我已经正确安装了 setuptools 和 argparse 1.2.1。
C:\Python25_64bit>python ez_setup.py argparse
Searching for argparse
Best match: argparse 1.2.1
Processing argparse-1.2.1-py2.5.egg
argparse 1.2.1 is already the active version in easy-install.pth
Using c:\python25_64bit\lib\site-packages\argparse-1.2.1-py2.5.egg
Processing dependencies for argparse
Finished processing dependencies for argparse
C:\Python25_64bit>python
Python 2.5.4 (r254:67916, Dec 23 2008, 15:19:34) [MSC v.1400 64 bit (AMD64)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named argparse
>>> quit()
但是,如您在上面看到的,我似乎无法导入它。我还尝试将 egg 直接添加到我的 Eclipse PyDev 项目中,但这也无济于事。如您所见,我的环境中没有设置任何内容。或许,这就是问题所在?
C:\Python25_64bit>echo %PYTHONPATH%
%PYTHONPATH%
C:\Python25_64bit>echo %PYTHONHOME%
%PYTHONHOME%