Py:run unable read child process output
Environment: Netlogo 6.3.0 I have tried on Python version 3.11, 3.10 and 3.9.13.
Netlogo is unable to read the code written in python, even the code is put in py:run. But it works on other's pc. Not sure why this error happens :(
Error code: Extension exception: Unable to read child process output. Try running the command again error while manufacturer 21536 running PY:RUN called by procedure CALIBRATION-GETLEARINGRATE (C:\Users\Joule\Desktop\ev market model 0331\manufacturer.nls) called by procedure SETUP-MANUFACTURER (C:\Users\Joule\Desktop\ev market model 0331\manufacturer.nls) called by procedure SETUP called by Button 'setup'
org.nlogo.nvm.WrappedExtensionException: Extension exception: Unable to read child process output. Try running the command again at org.nlogo.prim._extern.perform(_extern.java:40) at org.nlogo.nvm.Context.runExclusive(Context.java:133) at org.nlogo.nvm.ExclusiveJob.run(ExclusiveJob.scala:39) at org.nlogo.nvm.Context.runExclusiveJob(Context.java:177) at org.nlogo.prim._createturtles.perform(_createturtles.java:56) at org.nlogo.nvm.Context.stepConcurrent(Context.java:107) at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.scala:65) at org.nlogo.job.JobThread.runPrimaryJobs(JobThread.scala:133) at org.nlogo.job.JobThread.$anonfun$run$1(JobThread.scala:68) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.util.control.Exception$Catch.apply(Exception.scala:228) at org.nlogo.api.Exceptions$.handling(Exceptions.scala:41) at org.nlogo.job.JobThread.run(JobThread.scala:66) Caused by: org.nlogo.api.ExtensionException: Unable to read child process output. Try running the command again at org.nlogo.languagelibrary.Subprocess.receive(Subprocess.scala:432) at org.nlogo.languagelibrary.Subprocess.$anonfun$exec$4(Subprocess.scala:225) at org.nlogo.languagelibrary.Subprocess.$anonfun$async$1(Subprocess.scala:410) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)
NetLogo 6.3.0 main: org.nlogo.app.AppFrame thread: JobThread OpenJDK 64-Bit Server VM 17.0.3 (BellSoft; 17.0.3+7-LTS) operating system: Windows 11 10.0 (amd64 processor) Scala version 2.12.16 JOGL: (3D View not initialized) OpenGL Graphics: (3D View not initialized) model: main
02:15:56.944 SwitchedTabsEvent (org.nlogo.app.Tabs) AWT-EventQueue-0 02:15:56.934 RuntimeErrorEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 02:15:56.923 JobRemovedEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) JobThread 02:15:56.920 OutputEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 02:15:56.919 OutputEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 02:15:56.917 OutputEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 02:15:56.915 OutputEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 02:15:56.843 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0 02:15:56.843 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0 02:15:56.843 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
Problem solved
Chinese character in comments leads to error, remove those chinese character is fine to run
@louis21933 Glad to hear you found the root cause and got a workaround so you could run your code.
I've moved this to the Python extension repository so we can look at fixing the core problem so Chinese characters are allowed in comments as they should be.
@louis21933 Can you share the code that you ran that caused the error to occur? I've tried a few different small tests but so far everything is working as expected for me so having more information would help.
Adding a comment with the code is fine, or you can attach a model if you put it in a zip file first (GitHub doesn't allow nlogo attachments). Thanks!