简体   繁体   中英

cx_Freeze ImportError: No module named 'kivy-deps.gstreamer'

I am trying to create an exe file from my python code via cx_Freeze. When I run my setup.py file (which you may check below), I get an error message telling:

ImportError: No module named 'kivy-deps.gstreamer'

Can you tell me what I am doing wrong ?

(kivy-deps.gstreamer is installed, I also re-installed it to be sure)

Thanks in advance...

import sys
from cx_Freeze import setup, Executable


build_exe_options = {"packages": ["kivy","pygame","kivy-deps.gstreamer"], "includes": ["PIL","wheel","setuptools",], "excludes": []}


base = None
#if sys.platform == "win32":
#    base = "Win32GUI"

setup(
    name="guifoo",
    version="0.1",
    description="My GUI application!",
    options={"build_exe": build_exe_options},
    executables=[Executable("test.py", base=base)],
)

Try to use "kivy_deps.gstreamer" (with underscore) instead of "kivy-deps.gstreamer" (with hyphen) in the build_exe_options .

The corresponding import statement would namely read

import kivy_deps.gstreamer

not

import kivy-deps.gstreamer

probably because in that second statement the hyphen would be interpreted as a subtraction operator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM