Skip to content
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

Matlab R2018b kernel couldn't work well #122

Open
suixiaodan opened this issue May 31, 2019 · 7 comments
Open

Matlab R2018b kernel couldn't work well #122

suixiaodan opened this issue May 31, 2019 · 7 comments

Comments

@suixiaodan
Copy link

When I run the .ipynb file in the Matlab kernel, the wrong show as below:
[I 11:01:21.946 NotebookApp] Kernel started: 4bc3109a-5cfc-4533-8dc3-cd02c439dfdf [I 11:01:25.909 NotebookApp] Adapting to protocol v5.1 for kernel 4bc3109a-5cfc-4533-8dc3-cd02c439dfdf [MetaKernelApp] ERROR | Exception in message handler: Traceback (most recent call last): File "/home/matlab/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 272, in dispatch_shell yield gen.maybe_future(handler(stream, idents, msg)) File "/home/matlab/.local/lib/python3.5/site-packages/tornado/gen.py", line 729, in run value = future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result raise self._exception File "/home/matlab/.local/lib/python3.5/site-packages/tornado/gen.py", line 209, in wrapper yielded = next(result) File "/home/matlab/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 542, in execute_request user_expressions, allow_stdin, File "/usr/local/lib/python3.5/dist-packages/metakernel/_metakernel.py", line 386, in do_execute retval = self.do_execute_direct(code) File "/home/matlab/.local/lib/python3.5/site-packages/matlab_kernel/kernel.py", line 92, in do_execute_direct retval = self._execute_async(code) File "/home/matlab/.local/lib/python3.5/site-packages/matlab_kernel/kernel.py", line 250, in _execute_async future = self._matlab.eval(code, **kwargs) File "/home/matlab/.local/lib/python3.5/site-packages/matlab_kernel/kernel.py", line 68, in _matlab if self.__matlab: AttributeError: 'MatlabKernel' object has no attribute '_MatlabKernel__matlab'

What can I do?

@blink1073
Copy link
Contributor

Hi @suixiaodan, I think it is complaining because we check if self.__matlab is set before actually setting it. I'll push a fix.

@suixiaodan
Copy link
Author

Hi @suixiaodan, I think it is complaining because we check if self.__matlab is set before actually setting it. I'll push a fix.

Thank you.

@blink1073
Copy link
Contributor

Please try pip install -U matlab_kernel to pick up 0.16.5.

@suixiaodan
Copy link
Author

Please try pip install -U matlab_kernel to pick up 0.16.5.

I have updated to 0.16.5. But another mistake happened.

[I 11:59:33.015 NotebookApp] Creating new notebook in [W 11:59:34.045 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20190531115707 (172.27.76.20) 8.83ms referer=http://222.206.56.143:9977/notebooks/Untitled8.ipynb?kernel_name=matlab [I 11:59:34.120 NotebookApp] Kernel started: 27ff7f35-2099-438c-9bca-7398d37e89a5 [I 11:59:37.053 NotebookApp] Adapting to protocol v5.1 for kernel 27ff7f35-2099-438c-9bca-7398d37e89a5 [I 11:59:52.117 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports WARNING:root:kernel 27ff7f35-2099-438c-9bca-7398d37e89a5 restarted
The kernel restarted soon. However, it didn't work.

Thanks.

@blink1073 blink1073 reopened this May 31, 2019
@blink1073
Copy link
Contributor

What is the output of python -m matlab_kernel.check?

@suixiaodan
Copy link
Author

What is the output of python -m matlab_kernel.check?

The output is shown as below:

`matlab@92ec2d605402:/opt/matlab/R2018b/extern/engines/python$ python -m matlab_kernel.check
Matlab kernel v0.16.5
Metakernel v0.23.0
Python v3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609]
Python path: /usr/bin/python

Connecting to Matlab...
Matlab connection established
name 'o' is not defined`

@blink1073
Copy link
Contributor

Drat, there was a typo in check.py, can you please run python -m pip install -U matlab_kernel and then run python -m matlab_kernel.check again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants