https://wiki.python.org/moin/WindowsCompilers现在已经将基于distutils
的包(从from distutils.core import setup
开始)的指令完全替换为基于setuptools
的包(从from setuptools import setup
开始)的指令
但是,如果我有一个基于distutils
的setup.py
,当我运行它时,setuptools
没有被使用-因此页面上的指令不起作用
可以通过setuptools
运行基于distutils
的脚本,就像pip
那样,但是it requires the following code:
python -u -c "import setuptools, tokenize;__file__=<setup.py full path>;
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
.replace('\\r\\n', '\\n'), __file__, 'exec'))" <setup.py arguments>
他们不可能指望我每次都在命令行上输入,是吗
自询问之时起,https://wiki.python.org/moin/WindowsCompilers已更新为包含
distutils
的指令。要点是:distutils
只检测基本的编译器设置(通常是VisualStudio相应版本中包含的编译器)。指南中与这些设置相对应的部分明确提到distutils
对于其他设置,可以从“windowsdk命令提示符”运行它,并通过设置
DISTUTILS_USE_SDK
环境变量来告诉它依赖由它设置的环境变量MsSdk
环境变量李>相关问题 更多 >
编程相关推荐