OpenCV with standalone python executable (py2exe/pyinstaller)

后端 未结 2 1170
盖世英雄少女心
盖世英雄少女心 2021-01-28 11:29

I have a python program that uses OpenCV to get frames from a video file for processing. I then create a standalone executable using py2exe (also tried pyinstaller and got same

2条回答
  •  北海茫月
    2021-01-28 12:02

    Try using pyinstaller, download it using pip :

    pip install pyinstaller
    

    if you don't know how to install pip , try downloading python 2.7.9 or above, which has inbuilt pip, but don forget to add python path to environment varibles, this procedure is mentioned in this post:

    How to run Pip commands from CMD

    After installing pyinstaller, select the main file of your project and run this command

    pyinstaller yourprogram.py
    

    it will create folder with application file naming your file name, and finally make sure that numpy and opencv are in lib->site-packages folder of your python27 in your C Folder while running that command

    Hope it Helps!

提交回复
热议问题