【问题标题】:Problem using easy_install on Windows 7, 64 bit. (cannot find python.exe)在 Windows 7、64 位上使用 easy_install 时出现问题。 (找不到 python.exe)
【发布时间】:2011-01-20 06:45:55
【问题描述】:

我刚刚在我的 Windows 7(64 位)联想 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正确的。

我发现this bug report on 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 等完全陌生。

【问题讨论】:

    标签: python windows-7 mongodb easy-install


    【解决方案1】:

    我对这些特定的软件包一无所知,所以我可能帮不上什么忙。但是对于它的价值,我在使用 64 位 python 之前遇到了“找不到 python 可执行文件”错误。当我尝试安装的软件包没有 64 位版本并且它正在寻找 32 位 python 时,就会发生这种情况。我最终只是安装和使用了 32 位 python。这可能不是这里的问题,但我想我已经解决了。

    【讨论】:

    • 安装 32 位 Python 解决了这个问题。现在,使用 easy_install 和使用 python setup.py 安装这两种方法都可以正常工作。非常感谢。
    【解决方案2】:

    easy_install 帮不上什么忙——但是 python setup.py install 应该可以与 pymongo 一起使用。堆栈跟踪是什么?

    【讨论】:

    • 我添加了堆栈跟踪。我从来没有真正解决过这个问题,但是使用 32 位 Python 使我能够安装 pymongo,这对我来说已经足够好了。感谢您的努力。
    • 嗯,这很有趣——看起来这可能是 distutils 中 64 位 python 的错误。很高兴你让它工作了
    【解决方案3】:

    请安装此 64 位版本的 setuptools。

    http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools

    【讨论】:

      猜你喜欢
      • 2011-02-21
      • 2018-04-16
      • 2011-01-10
      • 2011-04-01
      • 2013-06-06
      • 1970-01-01
      • 1970-01-01
      • 2012-02-14
      相关资源
      最近更新 更多