我正在尝试在使用 oct2py 的简短 python 脚本中重用一些八度音程代码(在 1 .m 文件中)。python 脚本从 cmd 控制台正确运行。我什至可以使用 pyinstaller 将它打包成一个 exe(没有错误,只有几个警告),但是当我运行它时,可执行文件会抛出这个错误并退出:
---
C:\Users\Jason\Desktop\Oct2Py test>readFolder.exe
Traceback (most recent call last):
File "readFolder.py", line 2, in <module>
from oct2py import octave
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\oct2py\__init__.py", line 26, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\oct2py\core.py", line 14, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\octave_kernel\kernel.py", line 49, in <module>
File "site-packages\octave_kernel\kernel.py", line 54, in OctaveKernel
File "site-packages\octave_kernel\kernel.py", line 43, in get_kernel_json
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\toshiba\\AppData\\Local\\Temp\\_MEI94962\\octave_kernel\\kernel.json
[5220] Failed to execute script readFolder
我安装了最新版本的python(3.7.1)、oct2py(4.0.6)、pyinstaller等
感觉就像我错过了一些东西或没有在这里连接一些东西,有人可以帮我解决吗?谢谢!