在windows 7上安装python, python 3.4.3与pip



我尝试通过

在windows 7 64位(Python 3.4.3)上安装cython
pip install cython

并以错误消息

结束
 error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).

我觉得有点奇怪,因为我已经安装了visual studio community 2013。当我问windows vcvarsmall .bat在哪里时,它亲切地回答我

C:Usersme>where vcvarsall.bat
C:Program Files (x86)Microsoft Visual Studio 12.0VCvcvarsall.bat

所以它在我的路径上。我需要一个不同的视觉工作室版本,并与vcvarsall.bat的不同版本?

编辑1 我下载了VS2010 ISO SonicARG提供的。谢谢你!现在cython确认编译器,但仍然无法安装。

pip install cython
  Running setup.py install for cython
    Complete output from command C:Python34python.exe -c "import setuptools, tokenize;__file__='C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\setup.py';exec(compile(getattr(t
okenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record C:UsersmeAppDataLocalTemppip-lgya62cy-recordinstall-record.txt --single-version-external
ly-managed --compile:
    Unable to find pgen, not compiling formal grammar.
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.4
    copying cython.py -> buildlib.win-amd64-3.4
    creating buildlib.win-amd64-3.4Cython
    copying CythonCodeWriter.py -> buildlib.win-amd64-3.4Cython
    [Many lines of copying and creating]
    copying CythonDebuggerTestscfuncs.c -> buildlib.win-amd64-3.4CythonDebuggerTests
    running build_ext
    cythoning C:UsersmeAppDataLocalTemppip-build-12j3y7gpcythonCythonPlexScanners.py to C:UsersmeAppDataLocalTemppip-build-12j3y7gpcythonCythonPlexScanners.c
    building 'Cython.Plex.Scanners' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsersmeAppDataLocalTemppip-build-12j3y7gpcythonsetup.py", line 357, in <module>
        **setup_args
      File "C:Python34libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "C:Python34libdistutilsdist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:Python34libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:Python34libsite-packagessetuptoolscommandinstall.py", line 61, in run
        return orig.install.run(self)
      File "C:Python34libdistutilscommandinstall.py", line 539, in run
        self.run_command('build')
      File "C:Python34libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:Python34libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:Python34libdistutilscommandbuild.py", line 126, in run
        self.run_command(cmd_name)
      File "C:Python34libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:Python34libdistutilsdist.py", line 974, in run_command
        cmd_obj.run()
      File "C:UsersmeAppDataLocalTemppip-build-12j3y7gpcythonCythonDistutilsbuild_ext.py", line 164, in run
        _build_ext.build_ext.run(self)
      File "C:Python34libdistutilscommandbuild_ext.py", line 339, in run
        self.build_extensions()
      File "C:UsersmeAppDataLocalTemppip-build-12j3y7gpcythonsetup.py", line 192, in build_extensions
        build_ext_orig.build_extensions(self)
      File "C:UsersmeAppDataLocalTemppip-build-12j3y7gpcythonCythonDistutilsbuild_ext.py", line 172, in build_extensions
        self.build_extension(ext)
      File "C:Python34libdistutilscommandbuild_ext.py", line 503, in build_extension
        depends=ext.depends)
      File "C:Python34libdistutilsmsvc9compiler.py", line 460, in compile
        self.initialize()
      File "C:Python34libdistutilsmsvc9compiler.py", line 371, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:Python34libsite-packagessetuptoolsmsvc9_support.py", line 52, in query_vcvarsall
        return unpatched['query_vcvarsall'](version, *args, **kwargs)
      File "C:Python34libdistutilsmsvc9compiler.py", line 287, in query_vcvarsall
        raise ValueError(str(list(result.keys())))
    ValueError: ['path']
    ----------------------------------------
Command "C:Python34python.exe -c "import setuptools, tokenize;__file__='C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\setup.py';exec(compile(getattr(tokenize, 'open', open)(_
_file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record C:UsersmeAppDataLocalTemppip-lgya62cy-recordinstall-record.txt --single-version-externally-managed --compile" fa
iled with error code 1 in C:UsersmeAppDataLocalTemppip-build-12j3y7gpcython

Python 3.4是基于微软的Visual Studio 2010构建的;为了构建本机模块,您必须使用确切的版本。您可以下载Express Edition来构建它们,不需要整个IDE。你可以从这里获取VS2010的ISO文件,并安装c++组件,然后再试一次。

未来注意事项:如果您计划将Python升级到3.5(发布日期为2015年9月13日),那么Visual Studio版本将是2015年,因此如果您遇到保存问题

,您可以做好准备。

相关内容

  • 没有找到相关文章

最新更新