WolframResearch / WolframClientForPython

Call Wolfram Language functions from Python
https://wolfr.am/wolframclientdoc
MIT License
446 stars 47 forks source link

client hangs #26

Open dkhokhlov opened 4 years ago

dkhokhlov commented 4 years ago

In [1]: from wolframclient.evaluation import WolframLanguageSession In [2]: from wolframclient.language import wl, wlexpr In [3]: session = WolframLanguageSession('/opt/WolframEngine/12.1/Executables/WolframKernel') In [4]: session.evaluate(wl.WolframAlpha("number of moons of Saturn", "Result")) <<< hangs here indefinitely

In [5]: session.evaluate(wlexpr('Range[5]')) <<< hangs here indefinitely

Steps: Ubuntu 18.04.5 LTS conda version : 4.8.4 python version : 3.7.7.final.0

1) install development engine 2) activate 3) install client using pip

DbxDev commented 3 years ago

I wonder if that could be the same issue as #17. The problem you're facing is similar and you all are running Ubuntu.

GSam commented 3 years ago

I'm running v12.3 with Python 3.6.9 on Ubuntu.

The following works: session.evaluate(wlexpr('Range[5]'))

But I can definitely reproduce a hang with: session.evaluate(wl.WolframAlpha("number of moons of Saturn", "Result"))

Notably the following does return an answer, so there might be a separate issue with the second argument of WolframAlpha: session.evaluate(wl.WolframAlpha("number of moons of Saturn"))

GSam commented 3 years ago

I'm running v12.3 with Python 3.6.9 on Ubuntu.

The following works: session.evaluate(wlexpr('Range[5]'))

But I can definitely reproduce a hang with: session.evaluate(wl.WolframAlpha("number of moons of Saturn", "Result"))

Notably the following does return an answer, so there might be a separate issue with the second argument of WolframAlpha: session.evaluate(wl.WolframAlpha("number of moons of Saturn"))

Solved one of my hangs:

In[2]:= WolframAlpha["2+2", "Result"]
/usr/local/Wolfram/WolframEngine/12.3/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

Solved with: sudo apt-get install libasound2

I assume that libasound2 should be made an explicit dependency, or an instruction listed.

DbxDev commented 3 years ago

Here is the list of dependencies that the FrontEnd requires. Any FrontEnd dependent function eventually need them:

linux-vdso.so.1
libGL.so.1
libpthread.so.0
librt.so.1
libdl.so.2
libX11.so.6
libfontconfig.so.1
libstdc++.so.6
libm.so.6
libc.so.6
/lib64/ld-linux-x86-64.so.2
libgcc_s.so.1
libuuid.so.1
libz.so.1
libGLX.so.0
libGLdispatch.so.0
libasound.so.2
libxcb.so.1
libexpat.so.1
libXext.so.6
libXau.so.6
libXdmcp.so.6
libbsd.so.0

The command to get these: