Error when calling a jupyter notebook file from matlab

6 ビュー (過去 30 日間)
Rachel Dawn
Rachel Dawn 2020 年 11 月 12 日
回答済み: Jeff Miller 2020 年 11 月 13 日
So, I'm trying to run a jupyter notebook file from a matlab script:
status = system("runipy K-meansCBeam.ipynb")
*runipy is some program that runs jupyter files from the command terminal. I've tried typing in "runipy K-meansCBeam.ipynb" into the command terminal and it does run that jupyter file. But, not sure how to do this from a matlab script.
This is the error I get:
Traceback (most recent call last):
File "c:\users\user\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\user\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\User\anaconda3\Scripts\runipy.exe\__main__.py", line 7, in <module>
File "c:\users\user\anaconda3\lib\site-packages\runipy\main.py", line 132, in main
with open(args.input_file) as input_file:
FileNotFoundError: [Errno 2] No such file or directory: 'K-meansCBeam.ipynb'
status =
1

回答 (1 件)

Jeff Miller
Jeff Miller 2020 年 11 月 13 日
Just guessing here, but given that it is a file not found error, maybe you need to specify the path to the input file, something like:
status = system("runipy C:\MyPythonStuff\K-meansCBeam.ipynb")

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by