[英]Python pyinstaller error when converting py to exe
我正在尝试通过 pyinstaller 将我的 py 转换为 exe,但是它会响应错误消息。
谢谢!
我在下面输入的内容,
PS E:\Python\Scripts> pyinstaller.exe --onefile d:\Python Projects\Concept Number Generator\Concept Number Generator.py
什么反应是:
71 INFO: PyInstaller: 3.6
71 INFO: Python: 3.8.1
72 INFO: Platform: Windows-10-10.0.17763-SP0
73 INFO: wrote E:\Python\Scripts\Python.spec
77 INFO: UPX is not available.
Traceback (most recent call last):
File "e:\python\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "e:\python\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "E:\Python\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
File "e:\python\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "e:\python\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "e:\python\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "e:\python\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
exec(code, spec_namespace)
File "E:\Python\Scripts\Python.spec", line 6, in <module>
a = Analysis(['d:\\Python', 'Projects\\Concept', 'Number', 'Generator\\Concept', 'Number', 'Generator.py'],
File "e:\python\lib\site-packages\PyInstaller\building\build_main.py", line 191, in __init__
raise ValueError("script '%s' not found" % script)
ValueError: script 'd:\Python' not found
如评论中所述,当您输入它时不带引号,它会将它们解释为单独的 arguments ,因此这会导致给定的错误。
只需将它们封装在引号内
pyinstaller.exe --onefile "d:\Python Projects\Concept Number Generator"\"Concept Number Generator.py"
这应该可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.