我需要在我的机器上安装 pyproj,它给出了上述错误。我想对于使用 C++ 代码的其他 python 组件来说也是一样的:
我的情况:
Win 7 64 位运行。
已安装:
- VS 2008 Express
- Python 2.7 的 MS VS 补丁 http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
- 适用于 Windows 7 和 .NET Framework 3.5 SP1 的 Microsoft Windows SDK http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505
- 此处提供 Python 设置工具:http://pypi.python.org/pypi/setuptools#downloads
设置路径变量并设置
VS90COMNT工具 值:C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools
我尝试安装pyproj:http://jswhit.github.io/pyproj/
但它返回相同的错误:
File "msvc9compiler.py", line 271, in query_vcvarsall raise DistutilsPlatformError("Unable to find vcvarsall.bat") distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
这样做的目的是让 pygrib 包运行:http://jswhit.github.io/pygrib/docs/index.html
有人知道如何解决这个问题吗?
最佳答案
您可以使用 precompiled Python wheel 来安装它,而无需编译它。 。您可以在 this page containing unofficial wheels 找到 pyproj 的兼容轮子。 .
您正在专门寻找pyproj-1.9.4-cp27-none-win_amd64.whl
。下载 whl
文件后,您可以使用 pip 安装它
pip install pyproj-1.9.4-cp27-none-win_amd64.whl
这将为您安装它,跳过编译过程。
关于c++ - win7 64 上使用 Python 2.7.9 的 pyproj 给出 "Unable to find vcvarsall.bat",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27876226/