nanoric / c2py

Generate Source Files for Python C/C++ Extensions(.pyd files) from C/C++ headers automatically.
59 stars 11 forks source link

link.exe【failed: No such file or directory】 #5

Closed zx490336534 closed 5 years ago

zx490336534 commented 5 years ago

经常会看到 error: command 'E:\\VisualStudio2019\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x64\\link.exe' failed: No such file or directory 的报错,但是这个路径下link.exe是存在的

Exception in thread Thread-62:
Traceback (most recent call last):
  File "E:\python37\lib\distutils\spawn.py", line 69, in _spawn_nt
    rc = os.spawnv(os.P_WAIT, executable, cmd)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\python37\lib\distutils\_msvccompiler.py", line 424, in compile
    self.spawn(args)
  File "E:\python37\lib\distutils\_msvccompiler.py", line 543, in spawn
    return super().spawn(cmd)
  File "E:\python37\lib\distutils\ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "E:\python37\lib\distutils\spawn.py", line 38, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
  File "E:\python37\lib\distutils\spawn.py", line 75, in _spawn_nt
    "command %r failed: %s" % (cmd, exc.args[-1]))
distutils.errors.DistutilsExecError: command 'E:\\VisualStudio2019\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x64\\cl.exe' failed: No such file or d
irectory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\python37\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "E:\python37\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "setup.py", line 73, in _single_compile
    extra_postargs, depends)
  File "E:\python37\lib\distutils\_msvccompiler.py", line 426, in compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'E:\\VisualStudio2019\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x64\\cl.exe' failed: No such file or directo
ry

error: command 'E:\\VisualStudio2019\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x64\\link.exe' failed: No such file or directory
nanoric commented 5 years ago

请再全新的Windows下安装Visual Studio并测试一下? 编译器、链接器的问题不是c2py需要考虑的问题哦。

如果这个问题时不时出现,你可以尝试把--setup-use-patches这个参数去掉。这个参数是测试的时候用的,可能会对编译套件的使用产生影响。

zx490336534 commented 5 years ago

我把它的并行去掉了,就不会有这个报错了,感觉是并行的太猛了

nanoric commented 5 years ago

嗯,因为setuptools本身不支持并行编译。这个并行写的并不是非常完美。 如果没有其他问题的话,我就把这个issue关闭了哦。

zx490336534 commented 5 years ago

关吧,可以考虑在README.md里面加一下这个可能遇到的问题的解决方法

nanoric commented 5 years ago

嗯,我会整理成问题集锦的。