python打包时候报错,原本可以打包的,后来下载更新了其他库就不错了,原本可以打包的代码现在也打包不了了。
报错如下,需要如何解决?
D:\Python\Python38\Scripts\pyinstaller.exe -D -w test.py
138 INFO: PyInstaller: 5.1
138 INFO: Python: 3.8.0
138 INFO: Platform: Windows-10-10.0.16299-SP0
139 INFO: wrote D:\PyPj\test\test.spec
191 INFO: UPX is available.
193 INFO: Extending PYTHONPATH with paths
['D:\\PyPj\\test']
1032 INFO: checking Analysis
1655 INFO: checking PYZ
1793 INFO: checking PKG
1795 INFO: Bootloader d:\python\python38\lib\PyInstaller\bootloader\Windows-64bit\runw.exe
1795 INFO: checking EXE
1805 INFO: checking COLLECT
1805 INFO: Building COLLECT because COLLECT-00.toc is non existent
1805 INFO: Building COLLECT COLLECT-00.toc
2228 INFO: Executing - upx--lzma-qC:\Users\Administrator\AppData\Local\pyinstaller\bincache01_py38_64bit\markupsafe\_speedups.cp38-win_amd64.pyd
Traceback (most recent call last):
File "d:\python\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\python\python38\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Python\Python38\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
# The full license is in the file COPYING.txt, distributed with this software.
File "d:\python\python38\lib\PyInstaller\__main__.py", line 178, in run
run_build(pyi_config, spec_file, **vars(args))
File "d:\python\python38\lib\PyInstaller\__main__.py", line 59, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "d:\python\python38\lib\PyInstaller\building\build_main.py", line 842, in main
build(specfile, distpath, workpath, clean_build)
File "d:\python\python38\lib\PyInstaller\building\build_main.py", line 764, in build
exec(code, spec_namespace)
File "D:\PyPj\test\test.spec", line 41, in <module>
coll = COLLECT(
File "d:\python\python38\lib\PyInstaller\building\api.py", line 862, in __init__
self.__postinit__()
File "d:\python\python38\lib\PyInstaller\building\datastruct.py", line 173, in __postinit__
self.assemble()
File "d:\python\python38\lib\PyInstaller\building\api.py", line 894, in assemble
fnm = checkCache(
File "d:\python\python38\lib\PyInstaller\building\utils.py", line 367, in checkCache
subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
File "d:\python\python38\lib\subprocess.py", line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "d:\python\python38\lib\subprocess.py", line 804, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "d:\python\python38\lib\subprocess.py", line 1169, in _get_handles
c2pwrite = msvcrt.get_osfhandle(self._get_devnull())
File "d:\python\python38\lib\subprocess.py", line 952, in _get_devnull
self._devnull = os.open(os.devnull, os.O_RDWR)
FileNotFoundError: [Errno 2] No such file or directory: 'nul'
Process finished with exit code 1