jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

Video library can't find dependent lib on Windows #304

Open villares opened 3 years ago

villares commented 3 years ago

I'll try to investigate if this is caused by an unusual location of the Processing/sketchbook folder, but the Java mode video capture example worked fine... (Also working on Python mode on my Linux machine).

add_library('video')    # import processing.video.*
def setup():
    global video
    video = Capture(this, 640, 480)
    video.start()
    # ... actually I could reproduce with just the add_library() line

Error:

UnsatisfiedLinkError: D:\sketchbook_old\libraries\video\library\windows64\libgio-2.0-0.dll: Can't find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at jycessing.LibraryImporter.recursivelyLoadNativeLibraries(Unknown Source)
    at jycessing.LibraryImporter.addLibrary(Unknown Source)
    at jycessing.LibraryImporter$1.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(PyObject.java:480)
    at org.python.core.PyObject.__call__(PyObject.java:484)
    at org.python.pycode._pyx11.f$0(sketch_2020_07_30b.pyde:1)
    at org.python.pycode._pyx11.call_function(sketch_2020_07_30b.pyde)
    at org.python.core.PyTableCode.call(PyTableCode.java:171)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1614)
    at org.python.core.Py.exec(Py.java:1658)
    at org.python.pycode._pyx10.f$0(C:/Users/Lenovo/Desktop/sketch_2020_07_30b/sketch_2020_07_30b.pyde:96)
    at org.python.pycode._pyx10.call_function(C:/Users/Lenovo/Desktop/sketch_2020_07_30b/sketch_2020_07_30b.pyde)
    at org.python.core.PyTableCode.call(PyTableCode.java:171)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1614)
    at org.python.core.Py.exec(Py.java:1658)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276)
    at jycessing.PAppletJythonDriver.processSketch(Unknown Source)
    at jycessing.PAppletJythonDriver.findSketchMethods(Unknown Source)
    at jycessing.Runner.runSketchBlocking(Unknown Source)
    at jycessing.mode.run.SketchRunner.lambda$startSketch$3(Unknown Source)
    at java.lang.Thread.run(Thread.java:748)
Marvinvader commented 3 years ago

Just tried to figure this one out as well. I wish I had seen your post before. It is definitely only faulty on Windows but not on Mac. Any luck solving the issue? Otherwise, I will have to try the p5 library for Python and some other video library I can find.

villares commented 3 years ago

Hi @Marvinvader,

I know there are some people looking into library loading issues on Python mode (specially on Windows) but I guess they have been slowed down by the pandemic so, this one has no solution yet, unfortunatly.

I have been using a VirtualBox machine with some students, in some cases. I have not tried with the video library but it could also be a desperate move worth a try.

Marvinvader commented 3 years ago

A late comment from my side. I have borrowed a Mac to work around the problem which was only related to the video library on Windows. I also had a quick look into other options for Windows and Python only and Pyglet looked quite promising but I eventually decided to use Processing.py (and get a Mac) as I am more used to it.