ReinventCommunity icon indicating copy to clipboard operation
ReinventCommunity copied to clipboard

Py4JJavaError

Open Paulina-GM opened this issue 3 years ago • 5 comments

Hi,

I'm trying to run the Data_Preparation notebook but I keep getting the following error:

Py4JJavaError: An error occurred while calling z:org.apache.spark.api.python.PythonRDD.runJob. : org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 8.0 failed 1 times, most recent failure: Lost task 0.0 in stage 8.0 (TID 16) (Nucleus042.cm.cluster executor driver): org.apache.spark.api.python.PythonException: Traceback (most recent call last): File "/home2/s187304/.conda/envs/ReinventCommunity_P3.6/lib/python3.7/site-packages/pyspark/python/lib/pyspark.zip/pyspark/worker.py", line 477, in main ("%d.%d" % sys.version_info[:2], version)) Exception: Python in worker has different version 3.6 than that in driver 3.7, PySpark cannot run with different minor versions. Please check environment variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON are correctly set.

at org.apache.spark.api.python.BasePythonRunner$ReaderIterator.handlePythonException(PythonRunner.scala:517)
at org.apache.spark.api.python.PythonRunner$$anon$3.read(PythonRunner.scala:652)
at org.apache.spark.api.python.PythonRunner$$anon$3.read(PythonRunner.scala:635)
at org.apache.spark.api.python.BasePythonRunner$ReaderIterator.hasNext(PythonRunner.scala:470)
at org.apache.spark.InterruptibleIterator.hasNext(InterruptibleIterator.scala:37)
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:458)
at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:177)
at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:99)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:52)
at org.apache.spark.scheduler.Task.run(Task.scala:131)
at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:497)
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1439)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:500)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Driver stacktrace: at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:2258) at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:2207) at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:2206) at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62) at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49) at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:2206) at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1(DAGScheduler.scala:1079) at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1$adapted(DAGScheduler.scala:1079) at scala.Option.foreach(Option.scala:407) at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:1079) at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:2445) at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2387) at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2376) at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:49) at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:868) at org.apache.spark.SparkContext.runJob(SparkContext.scala:2196) at org.apache.spark.SparkContext.runJob(SparkContext.scala:2217) at org.apache.spark.SparkContext.runJob(SparkContext.scala:2236) at org.apache.spark.api.python.PythonRDD$.runJob(PythonRDD.scala:166) at org.apache.spark.api.python.PythonRDD.runJob(PythonRDD.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357) at py4j.Gateway.invoke(Gateway.java:282) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.spark.api.python.PythonException: Traceback (most recent call last): File "/home2/s187304/.conda/envs/ReinventCommunity_P3.6/lib/python3.7/site-packages/pyspark/python/lib/pyspark.zip/pyspark/worker.py", line 477, in main ("%d.%d" % sys.version_info[:2], version)) Exception: Python in worker has different version 3.6 than that in driver 3.7, PySpark cannot run with different minor versions. Please check environment variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON are correctly set.

at org.apache.spark.api.python.BasePythonRunner$ReaderIterator.handlePythonException(PythonRunner.scala:517)
at org.apache.spark.api.python.PythonRunner$$anon$3.read(PythonRunner.scala:652)
at org.apache.spark.api.python.PythonRunner$$anon$3.read(PythonRunner.scala:635)
at org.apache.spark.api.python.BasePythonRunner$ReaderIterator.hasNext(PythonRunner.scala:470)
at org.apache.spark.InterruptibleIterator.hasNext(InterruptibleIterator.scala:37)
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:458)
at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:177)
at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:99)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:52)
at org.apache.spark.scheduler.Task.run(Task.scala:131)
at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:497)
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1439)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:500)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
... 1 more

I have checked that the variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON are correctly set. Both are using python 3.7: PYSPARK_PYTHON=python3.7 PYSPARK_DRIVER_PYTHON=python3.7

I have also tried installing the environment downgrading the version of python to 3.6.4 without any success.

Thanks in advance for any help you can provide with this issue.

Paulina-GM avatar Oct 18 '21 22:10 Paulina-GM

@Paulina-GM I met similar errors. Please see https://github.com/MolecularAI/ReinventCommunity/issues/8 He said it is a memory problem, but I don't know how to fix it. I can't find where I can set the memory limit. If you know or you solve the problem, please share it.

xuzhang5788 avatar Oct 19 '21 06:10 xuzhang5788

Hi @Paulina-GM and @xuzhang5788 ,

I have recently updated the notebook tutorials to correspond with the new REINVENT 3.0 release. If you can re-install the conda environment and try the notebook again, making sure to execute cell #4, do you get the same error?:

DBS_PATH = "./data/chembl.mini.smi" parquet_file = f'{output_dir}/chembl.mini.parquet'

This cell block sets the path variables to a smaller example dataset which will require much less memory.

GuoJeff avatar Oct 21 '21 20:10 GuoJeff

@Paulina-GM @GuoJeff I reinstalled the new REINVENT 3.0 and reran the Data_Preparation.jpynb. It works now. Thanks @GuoJeff

xuzhang5788 avatar Oct 21 '21 22:10 xuzhang5788

Thank you all for your help. I have yet to try the solution but seems very promising.

Thank you again

From: xuzhang5788 @.> Sent: Thursday, October 21, 2021 5:57 PM To: MolecularAI/ReinventCommunity @.> Cc: Paulina Gonzalez @.>; Mention @.> Subject: Re: [MolecularAI/ReinventCommunity] Py4JJavaError (Issue #16)

EXTERNAL MAIL

@Paulina-GMhttps://github.com/Paulina-GM @GuoJeffhttps://github.com/GuoJeff I reinstalled the new REINVENT 3.0 and reran the Data_Preparation.jpynb. It works now. Thanks @GuoJeffhttps://github.com/GuoJeff

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/MolecularAI/ReinventCommunity/issues/16#issuecomment-949061273, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOHPP7Y6BUUZRQYR2UKIZYLUICLDPANCNFSM5GHXNHSQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. CAUTION: This email originated from outside UTSW. Please be cautious of links or attachments, and validate the sender's email address before replying.


UT Southwestern

Medical Center

The future of medicine, today.

Paulina-GM avatar Oct 22 '21 00:10 Paulina-GM

After I reinstalled it, I still reported the same error as the questioner

kong0706 avatar Feb 24 '22 02:02 kong0706