在 Windows 2016 和以下官方文档上,我已成功完成的compiled source code Python-3.6.12 。尝试build distribution时,出现以下错误,提示关于editor_flags。
还要注意,这来自于编译源代码,并且命令python
实际上调用了主目录中的python.bat
。
如果您需要更多详细信息,请告诉我,我们将不胜感激任何帮助或指示。
屏幕截图:
(来自CMD的python版本和异常回溯)
D:\Python\Python36>python -V
Running Release|x64 interpreter...
Python 3.6.12
D:\Python\Python36>python setup.py bdist
Running Release|x64 interpreter...
Traceback (most recent call last):
File "setup.py", line 29, in <module>
set_compiler_flags('CFLAGS', 'PY_CFLAGS_NODIST')
File "setup.py", line 27, in set_compiler_flags
sysconfig.get_config_vars()[compiler_flags] = flags + ' ' + py_flags_nodist
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
D:\Python\Python36>
更多信息:现在,我已经安装了pip,setuptools,wheel,并将“D:\Python\Python36”和“D:\Python\Python36”的目录添加到Path。但是,bdist上的错误保持不变。我是Python源代码发布的新手,所以感谢您的帮助和耐心。
截图:
D:\Python\Python36>python -m pip install --upgrade setuptools wheel
Running Release|x64 interpreter...
Requirement already up-to-date: setuptools in d:\python\python36\lib\site-packages (50.1.0)
Requirement already up-to-date: wheel in d:\python\python36\lib\site-packages (0.35.1)
...
D:\Python\Python36>python setup.py bdist
Running Release|x64 interpreter...
Traceback (most recent call last):
... the same error as before ...
最佳答案
尝试添加“NoneType”值和“str”值时,您似乎出错了。如果这些是您要连接的值,则应使用:
variable = ''.join(value 1, value 2)
关于python - 'python setup.py bdist'在 'compiler_flags'上获取错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63728136/