So, I am playing around on Almond with Scala 13.5 and Python 3.8. I encountered an issue with matplotlib. I first do this import:
val plt = py.module("matplotlib.pyplot")
The I execute:
plt.scatter(Seq(1,2,3).toPythonProxy, Seq(1,2,3).toPythonProxy)
But my JVM crashes and I get this error:
"Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!"
Anyone else has this issue? Can we not use libraries with GUI outputs, or maybe we need to do something in addition to that?
Module
in parallel. My module uses CPython libraries like pandas and NumPy. I was reusing the module instance and using the applyDynamic
method in each iteration. I noticed that there are over 10,000 files opened by the process. Is it expected behavior?
py.Any
that lets you release a Python value even if it's still held by Scala code
I am trying to run scalapy from intellij in my window machine. I am using anaconda python with python version 3.8.5 . I am getting the below error
`java.lang.UnsatisfiedLinkError: Unable to load library 'python3.8m':
The specified module could not be found.
The specified module could not be found.
The specified module could not be found.
Native library (win32-x86-64/python3.8m.dll) not found in resource path `
python-config --ldflags
to check where the libraries are installed?
python-config --ldflags
but it is giving me python-config is not recognized as an internal or external command,operable program or batch file.
error. Please help me with this
@bishnushankar95_twitter: Hmm, can you try running
from distutils import sysconfig;
print(sysconfig.get_config_var("LIBDIR"))
in Python? that should tell you where the shared libraries are
class scala_class extends py_class
.so
(linux) or .dylib
(mac) files next to your Python installation?
Hi all, ive created python module and now I want to call it from scala using ScalaPy.
I started with call the module and the specific function:
val testScalaPy = py.Module("my_module.test_feature")
val res = testScalaPy.TestFeature.extract(payload = 1)
And its works perfectly.
Now, i would like to be able to pass case class to the extract function:
case class Payload(value: Int)
val res = testScalaPy.TestFeature.extract(payload(100))
but im getting:
type mismatch;
found : com.riskified.poc.ScalaPyPocTest.Payload
required: me.shadaj.scalapy.py.Any
error after rewriting to feature.selectDynamic("TestFeature").applyDynamicNamed("extract")(scala.Tuple2("payload", Payload(200)))
possible cause: maybe a wrong Dynamic method signature?
Any ideas on how to implement writer/reader or if this ability exists already?
Writer
derivation)