Eryk Sun <eryk...@gmail.com> added the comment:

> cmd310 = ["/LIBPATH:D:\\python310\\lib\\site-packages\\torch\\lib",

The `argv` parameter of os.spawnv() should begin with a command name to ensure 
that the application parses its command-line correctly. This doesn't 
necessarily have to be a file path since the `path` argument is what gets 
executed. For example, in this case I would use `cmd310 = ["link", ...]`.

That said, for various reasons, including the correct quoting of command-line 
arguments that contain spaces, I recommend that you use the subprocess module 
instead of os.spawnv(). For example, use `p = subprocess.run(cmd310, 
executable=executable)`. The first item of the argument list still needs to be 
"link" in this case. Or include the full path of "link.exe" at the start of 
cmd310, and use `p = subprocess.run(cmd310)`.

> But i cant DEBUG os.spawnv() on Pycharm.

In Windows, os.spawnv() is a builtin function from the nt extension module, 
defined in Modules/posixmodule.c. It is not defined in os.py. The C 
implementation is a minimal wrapper around the C runtime's _wspawnv() function 
[1]. Probably PyCharm isn't capable of debugging a builtin function.

---
[1] 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnv-wspawnv

----------
components: +Windows -Build
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46578>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to