在Windows 7 64位系统上使用easy_install出现问题(找不到python.exe)

9
我刚刚在我的Windows 7 (64位) Lenovo t61p笔记本电脑上安装了Python 2.6。
我已经下载了Sphinxnose,并且显然已经正确地安装了它们。
python setup.py install

至少在安装过程中没有报错。

现在我正在尝试使用easy_install安装pymongo,但是我并没有取得太多成功。似乎easy_install根本不起作用。我以管理员身份执行easy_install

C:\>easy_install 
Cannot find Python executable C:\Program Files\Python26\python.exe

路径C:\Program Files\Python26\python.exe正确的。

我发现这个错误报告在bugs.python.org上,尽管它的状态为“已解决”,但似乎与此有关。

您有什么想法可能出了什么问题吗?欢迎提供任何进一步诊断问题的指针、提示或技巧。

编辑:这是我在尝试安装pymongo时收到的堆栈跟踪:

C:\Users\Rune Ibsen\Documents\Downloads\pymongo-1.4>python setup.py install
running install
running bdist_egg
running egg_info
writing pymongo.egg-info\PKG-INFO
writing top-level names to pymongo.egg-info\top_level.txt
writing dependency_links to pymongo.egg-info\dependency_links.txt
reading manifest file 'pymongo.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymongo.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'pymongo._cbson' extension
Traceback (most recent call last):
  File "setup.py", line 166, in <module>
    "doc": doc})
  File "C:\Program Files\Python26\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Program Files\Python26\lib\distutils\dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install.py", line 76, in run
  File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install.py", line 96, in do_egg_install
  File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\bdist_egg.py", line 174, in run
  File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\bdist_egg.py", line 161, in call_command
  File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install_lib.py", line 20, in run
  File "C:\Program Files\Python26\lib\distutils\command\install_lib.py", line 113, in build
    self.run_command('build_ext')
  File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "setup.py", line 107, in run
    build_ext.run(self)
  File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self.build_extension(ext)
  File "setup.py", line 117, in build_extension
    build_ext.build_extension(self, ext)
  File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 499, in build_extension
    depends=ext.depends)
  File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 448, in compile
    self.initialize()
  File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 358, in initialize
    vc_env = query_vcvarsall(VERSION, plat_spec)
  File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 274, in query_vcvarsall
    raise ValueError(str(list(result.keys())))
ValueError: [u'path']

C:\Users\Rune Ibsen\Documents\Downloads\pymongo-1.4>

PS.:我之前安装了Python 3.1,但后来安装了2.6,因为我不确定pymongo是否支持3.1。

PPS.:我尝试使用“python setup.py install”方法安装pymongo,但结果出现了一个难看的堆栈跟踪,所以我想尝试让easy_install为我处理它。

PPPS.:我完全是新手,对Python、easy_install、eggs等一无所知。

3个回答

6

我对这些特定的软件包一无所知,所以可能帮不上太多忙。但值得一提的是,我之前在使用64位Python时遇到过“找不到Python可执行文件”的错误。当我试图安装的软件包没有64位版本并且正在寻找32位Python时,就会出现这种情况。最后,我只安装并使用了32位Python。也许这里不是问题所在,但我想提一下。


1
安装32位Python解决了问题。现在,使用easy_install和使用python setup.py两种方法都可以正常工作。非常感谢。 - Rune

0

对于 easy_install 我帮不上太多忙 - 但是使用 python setup.py install 应该可以与 pymongo 兼容。堆栈跟踪是什么?


3
我添加了堆栈跟踪信息。虽然我并没有真正解决这个问题,但使用32位Python使我能够安装pymongo,这已经足够好了。感谢您的努力。 - Rune
嗯,那很有趣 - 看起来可能是64位Python distutils中的错误。不过很高兴你最终解决了。 - mdirolf

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接