简体   繁体   English

Python pyinstaller 将 py 转换为 exe 时出错

[英]Python pyinstaller error when converting py to exe

I am trying to convert my py to exe by pyinstaller, however it responses error message.我正在尝试通过 pyinstaller 将我的 py 转换为 exe,但是它会响应错误消息。

Thank you!谢谢!

What I entered below,我在下面输入的内容,

PS E:\Python\Scripts> pyinstaller.exe --onefile d:\Python Projects\Concept Number Generator\Concept Number Generator.py

What response was:什么反应是:

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

As mentioned in the comments, when you enter it without a quotation mark it interprets them as individual arguments and hence this leads to the given error.如评论中所述,当您输入它时不带引号,它会将它们解释为单独的 arguments ,因此这会导致给定的错误。

Simply encapsulate them within the quotation mark只需将它们封装在引号内

pyinstaller.exe --onefile "d:\Python Projects\Concept Number Generator"\"Concept Number Generator.py"

This should solve the problem.这应该可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将.py转换为.exe时出现Pyinstaller错误 - Pyinstaller Error when converting .py to .exe 转换为exe时出现Python pyinstaller错误 - Python pyinstaller error when converting to exe 使用 pyinstaller 将 python 文件转换为 an.exe 文件时出现 opencv 错误 - opencv error when converting a python file to an .exe file with pyinstaller 转换为.exe Pyinstaller时的Chromedriver路径错误 - Chromedriver Path Error when converting to .exe Pyinstaller 使用 pyinstaller 将 .py 转换为 .exe 后缺少模块 - missing modules after converting .py to .exe with pyinstaller 使用 pyinstaller 将 .py 转换为 .exe 文件 - Converting .py to .exe file using pyinstaller 使用pyinstaller和scipy模块将py文件转换为exe文件时出错。 知道可能是什么问题吗? - Error when converting py file to exe file using pyinstaller and scipy module. Any idea what could be the problem? 尝试使用Pyinstaller从.py脚本制作.exe时出现运行时错误 - Runtime error when trying to make a .exe from .py script with Pyinstaller 将.py文件转换为exe时出错 - Error when converting .py file to exe 使用 PyInstaller 将 python 3.7 脚本转换为 exe 时出错:ModuleNotFoundError - Error while converting python 3.7 script to exe using PyInstaller: ModuleNotFoundError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM