Pycharm lỗi khi dựng thành exe

Nhờ mọi người giúp đỡ mình với. hiện tại mình đã viết xong chương trình, chạy trên pycharm thì đã chạy được,nhưng khi buid thành file .exe thì bị lỗi, không đóng gói được. xin mọi nguoif chỉ giúp với ạ. Xin chân thành cảm ơn và có ít quà cảm ơn ạ.

1. UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  __import__(package)
2. Traceback (most recent call last):
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 33, in pywin32error
    yield
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\win32ctypes\pywin32\win32api.py", line 209, in BeginUpdateResource
    return _resource._BeginUpdateResource(filename, delete)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\win32ctypes\core\ctypes\_util.py", line 39, in check_null
    raise make_error(function, function_name)
OSError: [WinError 225] Operation did not complete successfully because the file contains a virus or potentially unwanted software.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\__main__.py", line 214, in _console_script_run
    run()
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\__main__.py", line 198, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\__main__.py", line 69, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\building\build_main.py", line 1071, in main
    build(specfile, distpath, workpath, clean_build)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\building\build_main.py", line 1011, in build
    exec(code, spec_namespace)
  File "C:\Users\ACER\Desktop\Tracnghiem\main.spec", line 18, in <module>
    exe = EXE(
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\building\api.py", line 628, in __init__
    self.__postinit__()
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\building\datastruct.py", line 184, in __postinit__
    self.assemble()
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\building\api.py", line 741, in assemble
    self._retry_operation(icon.CopyIcons, build_name, self.icon)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\building\api.py", line 1003, in _retry_operation
    return func(*args)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\utils\win32\icon.py", line 209, in CopyIcons
    return CopyIcons_FromIco(dstpath, [srcpath])
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\PyInstaller\utils\win32\icon.py", line 143, in CopyIcons_FromIco
    hdst = win32api.BeginUpdateResource(dstpath, 0)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\win32ctypes\pywin32\win32api.py", line 208, in BeginUpdateResource
    with _pywin32error():
  File "C:\Program Files\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\ACER\Desktop\Tracnghiem\venv\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
    raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (225, 'BeginUpdateResourceW', 'Operation did not complete successfully because the file contains a virus or potentially unwanted software.')

Dòng cuối cùng: Operation did not complete successfully because the file contains a virus or potentially unwanted software..

3 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?