前提・実現したいこと
コマンドライン上でipynbファイルを実行しようとして、
jupyter nbconvert --execute --inplace main3.ipynb
を実行したら、
以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
console
1> jupyter nbconvert --execute --inplace main3.ipynb 2[NbConvertApp] Converting notebook main3.ipynb to notebook 3[NbConvertApp] ERROR | Failed to run command: 4['C:\Users\username\anaconda3\envs\tf1\python.exe', '-m', 'ipykernel_launcher', '-f', 'C:\Users\username\AppData\Local\Temp\tmpo3vp9838.json', '--HistoryManager.hist_file=:memory:'] 5 PATH='C:\Users\username\anaconda3\envs\myenv;C:\Users\username\anaconda3\envs\myenv\Library\mingw-w64\bin;C:\Users\username\anaconda3\envs\myenv\Library\usr\bin;C:\Users\username\anaconda3\envs\myenv\Library\bin;C:\Users\username\anaconda3\envs\myenv\Scripts;C:\Users\username\anaconda3\envs\myenv\bin;C:\Users\username\anaconda3\condabin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\libnvvp;C:\Program Files (Free)\Python37\Scripts;C:\Program Files (Free)\Python37;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;...(文字数制限のため以下省略)...' 6 with kwargs: 7{'stdin': -1, 'stdout': None, 'stderr': None, 'cwd': None, 'close_fds': False} 8 9[NbConvertApp] ERROR | [WinError 2] 指定されたファイルが見つかりません。 10Traceback (most recent call last): 11 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\manager.py", line 351, in _async_start_kernel 12 await ensure_async(self._launch_kernel(kernel_cmd, **kw)) 13 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\utils.py", line 34, in ensure_async 14 return await obj 15 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\manager.py", line 269, in _async_launch_kernel 16 connection_info = await self.provisioner.launch_kernel(kernel_cmd, **kw) 17 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\provisioning\local_provisioner.py", line 179, in launch_kernel 18 self.process = launch_kernel(cmd, **scrubbed_kwargs) 19 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\launcher.py", line 169, in launch_kernel 20 raise ex 21 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\launcher.py", line 157, in launch_kernel 22 proc = Popen(cmd, **kwargs) 23 File "C:\Users\username\anaconda3\envs\myenv\lib\subprocess.py", line 951, in __init__ 24 self._execute_child(args, executable, preexec_fn, close_fds, 25 File "C:\Users\username\anaconda3\envs\myenv\lib\subprocess.py", line 1420, in _execute_child 26 hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 27FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。 28Traceback (most recent call last): 29 File "C:\Users\username\anaconda3\envs\myenv\lib\runpy.py", line 197, in _run_module_as_main 30 return _run_code(code, main_globals, None, 31 File "C:\Users\username\anaconda3\envs\myenv\lib\runpy.py", line 87, in _run_code 32 exec(code, run_globals) 33 File "C:\Users\username\anaconda3\envs\myenv\Scripts\jupyter-nbconvert.EXE\__main__.py", line 7, in <module> 34 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_core\application.py", line 264, in launch_instance 35 return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) 36 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\traitlets\config\application.py", line 846, in launch_instance 37 app.start() 38 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\nbconvertapp.py", line 361, in start 39 self.convert_notebooks() 40 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\nbconvertapp.py", line 533, in convert_notebooks 41 self.convert_single_notebook(notebook_filename) 42 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\nbconvertapp.py", line 498, in convert_single_notebook 43 output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer) 44 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\nbconvertapp.py", line 427, in export_single_notebook 45 output, resources = self.exporter.from_filename(notebook_filename, resources=resources) 46 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\exporters\exporter.py", line 186, in from_filename 47 return self.from_file(f, resources=resources, **kw) 48 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\exporters\exporter.py", line 204, in from_file 49 return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) 50 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\exporters\notebook.py", line 32, in from_notebook_node 51 nb_copy, resources = super().from_notebook_node(nb, resources, **kw) 52 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\exporters\exporter.py", line 143, in from_notebook_node 53 nb_copy, resources = self._preprocess(nb_copy, resources) 54 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\exporters\exporter.py", line 323, in _preprocess 55 nbc, resc = preprocessor(nbc, resc) 56 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\preprocessors\base.py", line 47, in __call__ 57 return self.preprocess(nb, resources) 58 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbconvert\preprocessors\execute.py", line 80, in preprocess 59 with self.setup_kernel(): 60 File "C:\Users\username\anaconda3\envs\myenv\lib\contextlib.py", line 119, in __enter__ 61 return next(self.gen) 62 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbclient\client.py", line 460, in setup_kernel 63 self.start_new_kernel(**kwargs) 64 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbclient\util.py", line 84, in wrapped 65 return just_run(coro(*args, **kwargs)) 66 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbclient\util.py", line 62, in just_run 67 return loop.run_until_complete(coro) 68 File "C:\Users\username\anaconda3\envs\myenv\lib\asyncio\base_events.py", line 642, in run_until_complete 69 return future.result() 70 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbclient\client.py", line 416, in async_start_new_kernel 71 await ensure_async(self.km.start_kernel(extra_arguments=self.extra_arguments, **kwargs)) 72 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\nbclient\util.py", line 96, in ensure_async 73 result = await obj 74 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\manager.py", line 362, in _async_start_kernel 75 raise e 76 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\manager.py", line 351, in _async_start_kernel 77 await ensure_async(self._launch_kernel(kernel_cmd, **kw)) 78 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\utils.py", line 34, in ensure_async 79 return await obj 80 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\manager.py", line 269, in _async_launch_kernel 81 connection_info = await self.provisioner.launch_kernel(kernel_cmd, **kw) 82 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\provisioning\local_provisioner.py", line 179, in launch_kernel 83 self.process = launch_kernel(cmd, **scrubbed_kwargs) 84 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\launcher.py", line 169, in launch_kernel 85 raise ex 86 File "C:\Users\username\anaconda3\envs\myenv\lib\site-packages\jupyter_client\launcher.py", line 157, in launch_kernel 87 proc = Popen(cmd, **kwargs) 88 File "C:\Users\username\anaconda3\envs\myenv\lib\subprocess.py", line 951, in __init__ 89 self._execute_child(args, executable, preexec_fn, close_fds, 90 File "C:\Users\username\anaconda3\envs\myenv\lib\subprocess.py", line 1420, in _execute_child 91 hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 92FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。
ここでusername
は自分のユーザ名を置換したものです。
自分のユーザ名は全てASCIIで表すことができるラテン文字で構成されています。
またmyenv
もAnacondaの環境名を置換していますが、
全てASCIIで表すことができるラテン文字で構成されています。
「指定されたファイルが見つかりません。」と出ていますが、
実行するファイルは明らかに存在します。
試したこと
- Visual Studio Codeでは当該ipynbファイルは実行できることを確認しました
- ターミナルの再起動
- パソコンの再起動
補足情報(FW/ツールのバージョンなど)
- OS: Windows 10 Pro
バージョン情報
console
1> conda --version 2conda 4.10.3 3> pip --version 4pip 21.3.1 from C:\Users\ichikawa\anaconda3\envs\myenv\lib\site-packages\pip (python 3.9) 5> python --version 6Python 3.9.7 7> jupyter --version 8Selected Jupyter core packages... 9IPython : 7.30.0 10ipykernel : 6.5.0 11ipywidgets : not installed 12jupyter_client : 7.1.0 13jupyter_core : 4.9.1 14jupyter_server : not installed 15jupyterlab : not installed 16nbclient : 0.5.9 17nbconvert : 6.3.0 18nbformat : 5.1.3 19notebook : not installed 20qtconsole : not installed 21traitlets : 5.1.1
あなたの回答
tips
プレビュー