我试图安装Python包dulwich:
pip install dulwich
但我得到一个神秘的错误信息:
error: Unable to find vcvarsall.bat
如果我尝试手动安装包,也会发生同样的情况:
> python setup.py install
running build_ext
building 'dulwich._objects' extension
error: Unable to find vcvarsall.bat
我试图找出用于在我的计算机上编译Python的Visual Studio版本
它说
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32
我不明白的是这个MSC V.1500名称.这是否意味着它是使用Visual Studio 2005编译的?我在http://python.org上找不到这些信息.
有没有办法在运行时显式强制编译器构建Cython扩展python setup.py install?setup.py形式在哪里:
import os.path
import numpy as np
from setuptools import setup, find_packages, Extension
from Cython.Distutils import build_ext
setup(name='test',
  packages=find_packages(),
  cmdclass={'build_ext': build_ext},
  ext_modules = [ Extension("test.func", ["test/func.pyx"]) ],
  include_dirs=[np.get_include()]
 )
我正在尝试使用Anaconda 3.16,Python 3.4,setuptools 18,Numpy 1.9和Cython 0.24在Windows 8.1 x64上安装软件包.部署脚本改编自用Cython 维基和这个 堆栈溢出的答案.
Makefile.bat
:: create and activate a virtual environement with conda
conda create --yes -n test_env cython setuptools=18 pywin32 libpython numpy=1.9 python=3
call activate test_env
:: activate the MS SDK compiler as explained in …