我知道这是一个严重记录的问题,但没有发布的解决方案已解决我的问题。试图在setup.py中安装numpy
这是我的代码
#!/usr/bin/env python
import os
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
setup(
name='MLM',
version='0.2dev',
setup_requires=['numpy'],
cmdclass={'build_ext': build_ext},
install_requires=[
'nltk',
'numpy'
],
license='MIT',
long_description=open('../README.md').read,
)
然而,当我运行python setup.py install
我得到:
File "D:\python\lib\site-packages\setuptools\command\easy_install.py", line 1106, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
您是否按照说明安装了MSVC++ 9? – lxop
@lxop这是可以添加到setup.py文件的东西吗? – Kat