当我跑步时:
valid_files = set() # empty set
with open('shuttle_image.csv', 'r') as f:
for rowDict in csv.reader(f, delimiter=','):
valid_files |= {rowDict[1]} # add file name to set
print(rowDict) # if desired
我收到错误:无法运行程序“kotlinc”:CreateProcess error = 2,系统找不到指定的文件
我试过了:
如果我从Windows检查我的路径,它包含new ProcessBuilder("kotlinc", "-help").start();
,当我在该位置打开资源管理器时,会有一个名为C:\Apps\kotlinc\bin
的文件。
如果我在任何地方打开kotlinc
并运行cmd.exe
,它就可以了。
如果我打印出我的环境:
kotlinc
它包含System.out.print(new ProcessBuilder("kotlinc", "-help").environment().get("Path"));
如果我运行C:\Apps\kotlinc\bin
,它就可以了。
更改new ProcessBuilder("python3", "file.py").start()
以使用完整文件路径不是可接受的解决方案,因为这是在多台计算机和平台上运行。
据我所知,一切都设置正确。
为什么我无法从kotlinc
投放kotlinc
?
答案 0 :(得分:3)
kotlinc
is actually a batch file (kotlinc.bat
), not a binary file. Therefore, you need to start it by executing the command cmd /c kotlinc
.