因此,尽管pyinstaller从未从包含该文件的文件夹中打开命令提示符,但pyinstaller无法找到该文件,因此我正在尝试更改我已命名为“ filename.py”的.spec文件中的某些内容。 我什至尝试插入整个文件路径,但仍然收到相同的错误。
PS C:\Users\S3401\Desktop\New folder> pyi-makespec filename.py
wrote C:\Users\S3401\Desktop\New folder\filename.spec
now run pyinstaller.py to build the executable
PS C:\Users\S3401\Desktop\New folder> pyinstaller .\filename.spec
46 INFO: PyInstaller: 3.3.1
46 INFO: Python: 3.6.6
46 INFO: Platform: Windows-10-10.0.17134-SP0
47 INFO: UPX is not available.
Traceback (most recent call last):
File "C:\Program Files\Python36\Scripts\pyinstaller-script.py", line 11, in <module>
load_entry_point('PyInstaller==3.3.1', 'console_scripts', 'pyinstaller')()
File "c:\program files\python36\lib\site-packages\PyInstaller\__main__.py", line 94, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\program files\python36\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\program files\python36\lib\site-packages\PyInstaller\building\build_main.py", line 791, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\program files\python36\lib\site-packages\PyInstaller\building\build_main.py", line 737, in build
exec(text, spec_namespace)
File "<string>", line 16, in <module>
File "c:\program files\python36\lib\site-packages\PyInstaller\building\build_main.py", line 162, in __init__
raise ValueError("script '%s' not found" % script)
ValueError: script 'filename.py' not found