Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Temp\protocbridge7256923893821185625.py", line , in <module>
s.sendall(content)
TypeError: a bytes-like object is required, not 'str'
--scala_out: protoc-gen-scala: Plugin failed with status code .
[error] java.lang.RuntimeException: protoc returned exit code:
[error] at scala.sys.package$.error(package.scala:)
[error] at sbtprotoc.ProtocPlugin$.compile(ProtocPlugin.scala:)
[error] at sbtprotoc.ProtocPlugin$.compileProto$(ProtocPlugin.scala:)
[error] at sbtprotoc.ProtocPlugin$.$anonfun$sourceGeneratorTask$(ProtocPlugin.scala:)
[error] at sbt.util.FileFunction$.$anonfun$cached$(FileFunction.scala:)
[error] at sbt.util.FileFunction$.$anonfun$cached$(FileFunction.scala:)
[error] at sbt.util.Difference.apply(Tracked.scala:)
[error] at sbt.util.Difference.apply(Tracked.scala:)
[error] at sbt.util.FileFunction$.$anonfun$cached$(FileFunction.scala:)
[error] at sbt.util.Difference.apply(Tracked.scala:)
[error] at sbt.util.Difference.apply(Tracked.scala:)
[error] at sbt.util.FileFunction$.$anonfun$cached$(FileFunction.scala:)
[error] at sbtprotoc.ProtocPlugin$.$anonfun$sourceGeneratorTask$(ProtocPlugin.scala:)
[error] at scala.Function1.$anonfun$compose$(Function1.scala:)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$(TypeFunctions.scala:)
[error] at sbt.std.Transform$$anon$.work(System.scala:)
[error] at sbt.Execute.$anonfun$submit$(Execute.scala:)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:)
[error] at sbt.Execute.work(Execute.scala:)
[error] at sbt.Execute.$anonfun$submit$(Execute.scala:)
[error] at sbt.ConcurrentRestrictions$$anon$.$anonfun$submitValid$(ConcurrentRestrictions.scala:)
[error] at sbt.CompletionService$$anon$.call(CompletionService.scala:)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
[error] at java.lang.Thread.run(Thread.java:)
[error] (Compile / protocGenerate) protoc returned exit code:
[error] Total time: s, completed -- ::
搜索了一下,根据https://github.com/scalapb/ScalaPB/issues/268的讨论,可能是安装的python版本问题,非2.x版本可能导致sbt package时出现上面的错误。安装python 2.7后问题解决。