Thanks to visit codestin.com
Credit goes to github.com

Skip to content

distutils MSVC: CCompiler_spawn() got an unexpected keyword argument 'env' #17216

@mbeyeler

Description

@mbeyeler

In the words of @jaraco, it looks like numpy is incompatible with pypa/distutils#6, which breaks the building of Cython-based extensions using MSVC. Triggered by switching from setuptools 49.6 to 50.0 (see also pypa/setuptools#2368)

Error message:

self.run_command('build_ext')
  File "c:\cibw\python\pythonx86.3.5.4\tools\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\cibw\python\pythonx86.3.5.4\tools\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
    cmd_obj.run()
  File "c:\cibw\python\pythonx86.3.5.4\tools\lib\site-packages\numpy\distutils\command\build_ext.py", line 274, in run
    self.build_extensions()
  File "D:\a\1\s\setup.py", line 168, in build_extensions
    if self.can_compile_link(compile_flags, link_flags):
  File "D:\a\1\s\setup.py", line 142, in can_compile_link
    extra_postargs=compile_flags)
  File "c:\cibw\python\pythonx86.3.5.4\tools\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 403, in compile
    self.spawn(args)
  File "c:\cibw\python\pythonx86.3.5.4\tools\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 507, in spawn
    return super().spawn(cmd, env=env)
  File "c:\cibw\python\pythonx86.3.5.4\tools\lib\site-packages\numpy\distutils\ccompiler.py", line 92, in <lambda>
    m = lambda self, *args, **kw: func(self, *args, **kw)
TypeError: CCompiler_spawn() got an unexpected keyword argument 'env'

Numpy/Python version information:

numpy-1.18.5-cp35-cp35m-win_amd64.whl
setuptools 50.0

Thanks,
Michael

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions