0
所以,我以为我已经正确安装了setuptools和argparse 1.2.1。无法在Windows上为python 2.5导入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()
但是,看起来我无法导入它,如上所述。我也试着直接将这个鸡蛋添加到我的Eclipse PyDev项目中,但这也无济于事。正如你所看到的,我的环境中没有设置任何东西。也许,这是问题吗?
C:\Python25_64bit>echo %PYTHONPATH%
%PYTHONPATH%
C:\Python25_64bit>echo %PYTHONHOME%
%PYTHONHOME%
我总是假设Lib/site-packages是导入搜索路径的一部分。这是不正确的? 'C:\ Python25_64bit \ Lib \ site-packages> dir ... C:\ Python25_64bit \ Lib \ site-packages目录 2012-08-28 05:41 PM