-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SocketAborted problem #17
Comments
Some preliminary questions:
|
Answer:
By the way, my windows10_x86_64 laptop works well with MMA 11.3 and 1.1.2 library. On my laptop, I executed wl.NSolve('- 2*x + 3 == 0') expecting a "x=1.5" result, but only got a empty tuple. What's the usage of this NSolve function in python? |
Can you provide a minimal example script that trigger the errors. From what I see above no code snippet is a working example (e.g. it is missing path). |
Below two examples will give errors in one of 2 types depending on the path I choose.
minimal example2:
|
Interestingly and strangely, I install MMA 12.0 and 1.1.2 library in docker container. In the container, minimal example scripts work well. |
These are not minimal working example scripts. Think of a piece of code that could work if stored in a file and run using: |
It's difficult to find the core part that generates the problem. But I tried to figure out it and found some clues. Type 1 error occurs because Then I tried to find where the
in function
so, I print out arguments that convey to the Popen():
stdin: -1, stdout: -1, stderr: -1, startupinfo: None Then, 437 line in file kernelcontroller.py,
, where Therefore, I dug into function
It seems that after executing Hope it will help! |
I think I have the same or similar issue on Wolfram Client Library version 1.1.4. I described this in this StackExchange post. My technical knowledge is limited but if there is a way to solve this please let me know. |
It's not possible to debug issues without a minimal runnable script which hasn't been provided. As stated on the above mentioned StackExchange post, it's possible that some orphan kernels exist. |
Facing the same issue on Ubuntu 20.04 with wolframclient==1.1.6 installed in a conda environment. I cannot provide a minimal working example since nothing works, so here is my minimal crashing example:
This prints
and the handling of that exception throws
Your explanation with the orphan kernels seems plausible since it worked once in the beginning, but the problem persists after reboot.
|
Here are some investigations to try narrow the source of bugs. The problem you're facing is that the kernel process ends abruptly. @MaxKinny that's why Could you setup Python logging to see if there is anything useful printed using: import logging
logging.basicConfig(level=logging.DEBUG) It'll print to stdout. You should see the command used to start the WolframLanguage kernel. On my machine I get something like this:
Note that this is the code for Using this command, you can try to mock the python side with Wolfram Language and see if the problem remains. In a fresh kernel, open two ZMQ sockets with appropriate types:
Now edit the starting command with the above ports. In my case the command becomes: /Applications/Mathematica.app/Contents/MacOS/WolframKernel -noprompt -initfile /Users/dorianb/.../WolframClientForPython/wolframclient/evaluation/kernel/initkernel.m -run 'ClientLibrary`Private`KernelPrivateStart["tcp://127.0.0.1:53004", "tcp://127.0.0.1:53008"];' And run it in a terminal. Hopefully you'll see an error in your terminal that will help debugging your issue. While the above runs, go back to the kernel and run the following.
If you get this it means that the kernel initialization was successful. I doubt you'll receive the message. But if you do, you can also try to evaluate something using:
|
Also for the record, I just was able to run a |
Used this code to help debug and realized that one of my Wolfram folders had the wrong permissions on Ubuntu. Must have accidentally run as root somewhere. Thanks for that tip! |
I'm glad you were able to track this down. |
|
My Environment:
Activated MMA 12.0 works correctly on my Ubuntu 16.04 system.
I install WolframClient with following code:
Then I execute following codes in python 3.6.10:
where, the path I try different values like the result of :
in my case, it's '/usr/local/bin/WolframKernel' , or the output of
which is
'/usr/local/Wolfram/Mathematica/12.0/SystemFiles/Kernel/Binaries/Linux-x86-64/WolframKernel'
or use this path
'/usr/local/Wolfram/Mathematica/12.0/Executables/WolframKernel' which is default path of WolframLanguageSession().
Then errors are vary when I choose different paths, but can be concluded into 2 types.
The text was updated successfully, but these errors were encountered: