weixin_42691598 2022-06-29 11:09 采纳率: 33.3%
浏览 27

Python 打包报错

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


  • 写回答

1条回答 默认 最新

  • 二九筒 2022-06-29 14:19
    关注

    不是都提示了吗 没有找到nul这个文件

    img

    评论

报告相同问题?

问题事件

  • 创建了问题 6月29日

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!