Tried to make an exe file

370 views
Skip to first unread message

Electronic Part

unread,
Dec 24, 2019, 3:02:44 AM12/24/19
to Kivy users support
Hello,

I have attached my codes . I got following error:


[CRITICAL] [App         ] Unable to get a Window, abort. 


I used this command:

pyinstaller --onefile rvupdate.py

Every help would be appreciate in advance. Thanks for your attention  



main.kv
rvupdate.py
rvupdate.spec

Electronic Part

unread,
Dec 24, 2019, 3:31:14 AM12/24/19
to kivy-...@googlegroups.com
Actually the error is 

sdl2 - Exception: SDL2: Unable to load image

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/779b4a7c-0ef6-4253-8a27-23b397f3c234%40googlegroups.com.

Electronic Part

unread,
Dec 24, 2019, 4:53:53 AM12/24/19
to kivy-...@googlegroups.com
By the way i am using conda 
Here is my log in pycharm

(conda_evnv) (venv) D:\code\final_designe\test\rekivyusershowtoupdaterecycleviewdata\dist>rvupdate.exe
[INFO   ] [Logger      ] Record log in C:\Users\Hamid\.kivy\logs\kivy_19-12-24_29.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\Hamid\AppData\Local\Temp\_MEI53522\kivy\__init__.pyc"
[INFO   ] [Python      ] v3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "D:\code\final_designe\test\rekivyusershowtoupdaterecycleviewdata\dist\rvupdate.exe"
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [Cache       ] register <kv.lang> with limit=None, timeout=None
[DEBUG  ] [Cache       ] register <kv.image> with limit=None, timeout=60
[DEBUG  ] [Cache       ] register <kv.atlas> with limit=None, timeout=None
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[DEBUG  ] [Cache       ] register <kv.texture> with limit=1000, timeout=60
[DEBUG  ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600
Read
row = ('admin     ', '1234      ', None)
[DEBUG  ] [App         ] Loading kv <.\updaterv.kv>
[DEBUG  ] [App         ] kv <.\updaterv.kv> not found
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[DEBUG  ] [GL          ] available extensions: b'GL_AMDX_debug_output GL_AMDX_vertex_shader_tessellator GL_AMD_conservative_depth GL_AMD_debug_output GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_multi_draw_indirect GL_AMD_name_gen_delete GL_AMD_p
erformance_monitor GL_AMD_pinned_memory GL_AMD_query_buffer_object GL_AMD_sample_positions GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_stencil_export GL_AMD_shader_trace GL_AMD_texture_cube_map_array GL_AMD_texture_texture4 GL_AMD_transform_feedback3_lines
_triangles GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_tessellator GL_AMD_vertex_shader_viewport_index GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB
_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_c
opy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_v
ertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_A
RB_fragment_shader GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_fl
oat_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multit
exture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_a
ccess_behavior GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_image_load_store GL_ARB_shader_image_si
ze GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_stencil_export GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack G
L_ARB_shading_language_packing GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_b
uffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_
ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg
GL_ARB_texture_rgb10_a2ui GL_ARB_texture_snorm GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_
feedback_instanced GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex
_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_
ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex
_array GL_EXT_copy_buffer GL_EXT_copy_texture GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sR
GB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_histogram GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_cl
amp GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texgen_reflection GL_EXT_texture3D G
L_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_bptc GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_textu
re_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode G
L_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_IBM_texture_mirrored_repeat GL_KHR_context_fl
ush_control GL_KHR_debug GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KTX_buffer_region GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_explicit_multisample GL_NV_float_buffer GL_
NV_half_float GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_barrier GL_OES_EGL_image GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_swap_control'
[DEBUG  ] [GL          ] glShaderBinary is not available
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.5.13399 Compatibility Profile Context 15.200.1062.1004'>
[INFO   ] [GL          ] OpenGL vendor <b'ATI Technologies Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'AMD Radeon HD 5800 Series'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 5
[INFO   ] [GL          ] Shading version <b'4.40'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <18>
[DEBUG  ] [Shader      ] Fragment compiled successfully
[DEBUG  ] [Shader      ] Vertex compiled successfully
[DEBUG  ] [ImageSDL2   ] Load <C:\Users\Hamid\AppData\Local\Temp\_MEI53522\kivy_install\data\glsl\default.png>
[WARNING] [Image       ] Unable to load image <C:\Users\Hamid\AppData\Local\Temp\_MEI53522\kivy_install\data\glsl\default.png>
[CRITICAL] [Window      ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes

sdl2 - Exception: SDL2: Unable to load image
  File "site-packages\kivy\core\__init__.py", line 71, in core_select_lib
  File "site-packages\kivy\core\window\window_sdl2.py", line 152, in __init__
  File "site-packages\kivy\core\window\__init__.py", line 981, in __init__
  File "site-packages\kivy\core\window\window_sdl2.py", line 312, in create_window
  File "site-packages\kivy\core\window\__init__.py", line 1258, in create_window
  File "kivy\graphics\instructions.pyx", line 783, in kivy.graphics.instructions.RenderContext.__init__
  File "site-packages\kivy\core\image\__init__.py", line 561, in __init__
  File "site-packages\kivy\core\image\__init__.py", line 756, in _set_filename
  File "site-packages\kivy\core\image\__init__.py", line 460, in load
  File "site-packages\kivy\core\image\__init__.py", line 223, in __init__
  File "site-packages\kivy\core\image\img_sdl2.py", line 47, in load


[CRITICAL] [App         ] Unable to get a Window, abort.

Elliot Garbus

unread,
Dec 24, 2019, 10:08:22 AM12/24/19
to kivy-...@googlegroups.com

The problem you have is that you need to tell pyinstaller where the .kv files are located.  The datas section in the kv file is used for this.

You have also not captured some of dependencies.  There is a section on kivy.org for packaging apps.

 

I have attached a specfile I use for packaging kivy apps on Windows10.  You will need to change the app_name and win_icon  as appropriate. Then run:

Pyinstaller -spec w10.spec

 

I usually make a 1 directory build, and then package the file into an installable executable using Inno Setup.  It make a very nice Windows Installer, and  has a wizard that makes it very easy to use.  http://www.jrsoftware.org/isinfo.php

--

w10.spec

Will Tejeda

unread,
Dec 24, 2019, 3:19:33 PM12/24/19
to kivy-...@googlegroups.com
I've been trying to build exe on Windows 10 with kivy+kivymd and have kept getting this issue  about a python.runtime not found

Snapchat-1407548706.jpg

Elliot Garbus

unread,
Dec 24, 2019, 7:46:03 PM12/24/19
to kivy-...@googlegroups.com

Can you create a .exe from a small example successfully?

Create a small test app, and see if you can package it.  If that works can move from there.

Will Tejeda

unread,
Dec 24, 2019, 9:33:43 PM12/24/19
to kivy-...@googlegroups.com

Elliot Garbus

unread,
Dec 24, 2019, 10:57:17 PM12/24/19
to kivy-...@googlegroups.com
Attach your .py file, .spec file and the error you see. 

Sent from my iPhone

On Dec 24, 2019, at 7:33 PM, Will Tejeda <in...@willtejeda.com> wrote:



Electronic Part

unread,
Dec 25, 2019, 12:28:16 AM12/25/19
to Kivy users support
Thanks for your help. Could you tell me all commands that i need to make an exe by pyinstaller?

Elliot Garbus

unread,
Dec 25, 2019, 1:20:34 AM12/25/19
to kivy-...@googlegroups.com

 

Have you tried using the spec file I sent?  Edit to match your program.  Share a list of the files in your project if you need some help.

 

Create a directory, under your project directory.  Call in myappdist

Put the spec file there

change to that directory

then run pyinstaller: pyinstaller -spec w10.spec

you should have a directory called dist with the .exe in it.  You can run this file.  If there is any problem look at the kivy log file for clues.

 

Then start the Inno Setup complier, select create a new script file using the Script Wizard.  Fill in the forms. This will create an installer and uninstaller.

It will run, package up and install your program into and installable exe.

 

Good luck!

 

From: Electronic Part
Sent: Tuesday, December 24, 2019 10:28 PM
To: Kivy users support
Subject: Re: [kivy-users] Tried to make an exe file

 

Thanks for your help. Could you tell me all commands that i need to make an exe by pyinstaller?

--

You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Electronic Part

unread,
Dec 25, 2019, 2:06:13 AM12/25/19
to kivy-...@googlegroups.com
I tried hello world . I got the same error. I think something is wrong with pyinstaller installation. I have attached the hello word file(there is no .kv file)

This is the error

[CRITICAL] [App         ] Unable to get a Window, abort.

Command i used pyinstaller --onefile test3.py

Please help me 

On Wed, Dec 25, 2019 at 8:58 AM Electronic Part <hsiel...@gmail.com> wrote:
Thanks for your help. Could you tell me all commands that i need to make an exe by pyinstaller?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Elliot Garbus

unread,
Dec 25, 2019, 7:34:59 AM12/25/19
to kivy-...@googlegroups.com

Try using this spec file, as I attached previously.  Here are a few details to understand.

  • I put this file in a directory below my project directory.
  • The spec file is python code.  You can see what is going into any section by adding print statements. 
  • Key dependencies from python are imported. Sdl2 and glew.  In the collect statement toward the bottom of the file, these binaries are collected and put into the package.  *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)]
  • ‘datas’ is a list of associated data files.  You are telling pyinstaller where to find them, and where to put them in the frozen package.  I’m putting them in the current working directory of the frozen package (‘.’).  If your data files are in a different source directory or you have additional data file, they need to get added to this list.
  • Change ‘Your App Name Here’ to be the name you want to give your app.
  • Change YourIconFIleHere.ico to the icon file you want for your app.
  • The line hiddenimports adds ‘wint32timezone’  I found this is a dependency if you are using the filechooser.
  • The kivy log often provides useful information when trying to get pyinstaller to work properly.  It will show you for example if a file has not been found.

 

 

 

# -*- mode: python -*-

import os
from kivy_deps import sdl2, glew

spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name = 'Your App Name Here'
win_icon = '../YourIconFileHere.ico'

a = Analysis(['../main.py'],
             pathex=[spec_root],
             datas=[('../*.kv', '.'), ('../*.png', '.')],
             hiddenimports=['win32timezone'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          [],
          exclude_binaries=True,
          name=app_name,
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=False,
          console=False,
          icon=win_icon)
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
               strip=False,
               upx=False,
               name=app_name)

 

 

 

 

 

From: Electronic Part
Sent: Wednesday, December 25, 2019 12:06 AM
To: kivy-...@googlegroups.com
Subject: Re: [kivy-users] Tried to make an exe file

 

I tried hello world . I got the same error. I think something is wrong with pyinstaller installation. I have attached the hello word file(there is

w10.spec

Electronic Part

unread,
Dec 25, 2019, 7:57:05 AM12/25/19
to kivy-...@googlegroups.com
Please share with me the command that you used for making exe file. I am still the same error even by using your recommendation . Sorry for taking your time

Elliot Garbus

unread,
Dec 25, 2019, 8:00:26 AM12/25/19
to kivy-...@googlegroups.com

Pyinstaller -spec w10.spec

no .kv file)

 

This is the error

 

[CRITICAL] [App         ] Unable to get a Window, abort.

 

Command i used pyinstaller --onefile test3.py

 

Please help me 

 

On Wed, Dec 25, 2019 at 8:58 AM Electronic Part <hsiel...@gmail.com> wrote:

Thanks for your help. Could you tell me all commands that i need to make an exe by pyinstaller?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/e3521c5d-b4fd-4d88-8a9d-098d9f8cc370%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAGb7shToRHeLToVbtfzrp11Q%3D%2B8wR3zFBFrSE_pib5CRX6NZcg%40mail.gmail.com.

 

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5e03576a.1c69fb81.d4f5e.58aaSMTPIN_ADDED_MISSING%40gmr-mx.google.com.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Elliot Garbus

unread,
Dec 25, 2019, 8:01:47 AM12/25/19
to kivy-...@googlegroups.com

If your file name is not main you would need to change the first line in the Analysis section to point to your .py file.

 

This is the error

 

[CRITICAL] [App         ] Unable to get a Window, abort.

 

Command i used pyinstaller --onefile test3.py

 

Please help me 

 

On Wed, Dec 25, 2019 at 8:58 AM Electronic Part <hsiel...@gmail.com> wrote:

Thanks for your help. Could you tell me all commands that i need to make an exe by pyinstaller?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/e3521c5d-b4fd-4d88-8a9d-098d9f8cc370%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAGb7shToRHeLToVbtfzrp11Q%3D%2B8wR3zFBFrSE_pib5CRX6NZcg%40mail.gmail.com.

 

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5e03576a.1c69fb81.d4f5e.58aaSMTPIN_ADDED_MISSING%40gmr-mx.google.com.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Electronic Part

unread,
Dec 26, 2019, 1:16:50 AM12/26/19
to kivy-...@googlegroups.com
Merry Christmas to you. I am still getting same error. I don't know. I could make an app earlier when i was using kivy 1.10.1 and now after upgrading to kivy 1.11.1, i am getting this error
[CRITICAL] [App         ] Unable to get a Window, abort.
That drives me crazy. I know it is because of a simple reason. Unfortunately, i am not able to understand how to resolve it   

Elliot Garbus

unread,
Dec 26, 2019, 9:16:25 AM12/26/19
to kivy-...@googlegroups.com

Create a small test app.  Share the app and the spec file.  Let me know where the files are located, and I can suggest how to resolve the issue.

 

The name of the dependencies changed in the transition to 1.11, ( what was previously a ‘.’ Changed to an ‘_’). if you had a spec file you were using previously it would need to be updated.

Electronic Part

unread,
Dec 28, 2019, 1:38:07 AM12/28/19
to kivy-...@googlegroups.com
test3.py
test3.spec

Elliot Garbus

unread,
Dec 28, 2019, 9:02:31 AM12/28/19
to kivy-...@googlegroups.com
Here are a few comments that go with the highlights below.
I’m mot familiar with these from and too lines, but they cause an error for me.
 
I’ve found that windows will accept the/file/separator/ on input to all file and path related functions. It will return //, but it will accept /.
 
The variable app_name has not been defined.  The app name goes in 2 places, So I create a variable app_name at the top of the file, and put it in 2 places, you have put ‘test3’ in the EXE section, you should also put ‘test3’ in Collections.
 
I would expect those 2 Tree statements would work fine.  I’m using: *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)]
 
The specfile is python code, it can be helpful to add print statements to see what is being created.
 
# -*- mode: python ; coding: utf-8 -*-
From: [Python]\share\sdl2\bin\libpng16-16.dll
To:   [Dist]\<projectName>\libpng16-
16.dll

import os
from kivy_deps import sdl2, glew

spec_root = os.path.abspath(SPECPATH)

block_cipher =
None


a = Analysis(['test3.py'],
            
pathex=['spec_root'],
            
binaries=[],
            
datas=['spec_root\\test3.kv','.'],
            
hiddenimports=['win32timezone'],
            
hookspath=[],
            
runtime_hooks=[],
            
excludes=[],
            
win_no_prefer_redirects=False,
            
win_private_assemblies=False,
            
cipher=block_cipher,
            
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
            
cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
         
name='test3',
         
debug=True,
         
bootloader_ignore_signals=False,
         
strip=False,
         
upx=True,
         
upx_exclude=[],
         
runtime_tmpdir=None,
         
console=True )

coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               Tree('D:\\ProgramData\\Anaconda3\\envs\\conda_evnv\\share\\sdl2\\bin\\'),
               Tree('D:\\ProgramData\\Anaconda3\\envs\\conda_evnv\\share\\glew\\bin\\'),

              
strip=False,
              
upx=False,
              
name=app_name)


Electronic Part

unread,
Dec 28, 2019, 11:59:01 PM12/28/19
to kivy-...@googlegroups.com
Thanks for your time. Even by applying your comments i am getting the same thing, That is interesting that i did not get any error like this when i was the old version of kivy(1.10.1). I am sure it is from there. 

Here is my conda packages

#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0
alabaster                 0.7.12                   py37_0
anaconda                  2019.10                  py37_0
anaconda-client           1.7.2                    py37_0
anaconda-navigator        1.9.7                    py37_0
anaconda-project          0.8.3                      py_0
asn1crypto                1.0.1                    py37_0
astroid                   2.3.1                    py37_0
astropy                   3.2.1            py37he774522_0
atomicwrites              1.3.0                    py37_1
attrs                     19.2.0                     py_0
babel                     2.7.0                      py_0
backcall                  0.1.0                    py37_0
backports                 1.0                        py_2
backports.functools_lru_cache 1.6.1                      py_0
backports.os              0.1.1                    py37_0
backports.shutil_get_terminal_size 1.0.0                    py37_2
backports.tempfile        1.0                        py_1
backports.weakref         1.0.post1                  py_1
beautifulsoup4            4.8.0                    py37_0
bitarray                  1.0.1            py37he774522_0
bkcharts                  0.2                      py37_0
blas                      1.0                         mkl
bleach                    3.1.0                    py37_0
blosc                     1.16.3               h7bd577a_0
bokeh                     1.3.4                    py37_0
boto                      2.49.0                   py37_0
bottleneck                1.2.1            py37h452e1ab_1
bzip2                     1.0.8                he774522_0
ca-certificates           2019.8.28                     0
certifi                   2019.9.11                py37_0
cffi                      1.12.3           py37h7a1dbc1_0
chardet                   3.0.4                 py37_1003
click                     7.0                      py37_0
cloudpickle               1.2.2                      py_0
clyent                    1.2.2                    py37_1
colorama                  0.4.1                    py37_0
comtypes                  1.1.7                    py37_0
conda                     4.8.0                    py37_1
conda-build               3.18.9                   py37_3
conda-env                 2.6.0                         1
conda-package-handling    1.6.0            py37h62dcd97_0
conda-verify              3.4.2                      py_1
console_shortcut          0.1.1                         3
contextlib2               0.6.0                      py_0
cryptography              2.7              py37h7a1dbc1_0
curl                      7.65.3               h2a8f88b_0
cycler                    0.10.0                   py37_0
cython                    0.29.13          py37ha925a31_0
cytoolz                   0.10.0           py37he774522_0
dask                      2.5.2                      py_0
dask-core                 2.5.2                      py_0
decorator                 4.4.0                    py37_1
defusedxml                0.6.0                      py_0
distributed               2.5.2                      py_0
docutils                  0.15.2                   py37_0
entrypoints               0.3                      py37_0
et_xmlfile                1.0.1                    py37_0
fastcache                 1.1.0            py37he774522_0
filelock                  3.0.12                     py_0
flask                     1.1.1                      py_0
freetype                  2.9.1                ha9979f8_1
fsspec                    0.5.2                      py_0
future                    0.18.2                   py37_0
get_terminal_size         1.0.0                h38e98db_0
gevent                    1.4.0            py37he774522_0
glob2                     0.7                        py_0
greenlet                  0.4.15           py37hfa6e2cd_0
h5py                      2.9.0            py37h5e291fa_0
hdf5                      1.10.4               h7ebc959_0
heapdict                  1.0.1                      py_0
html5lib                  1.0.1                    py37_0
icc_rt                    2019.0.0             h0cc432a_1
icu                       58.2                 ha66f8fd_1
idna                      2.8                      py37_0
imageio                   2.6.0                    py37_0
imagesize                 1.1.0                    py37_0
importlib_metadata        0.23                     py37_0
intel-openmp              2019.4                      245
ipykernel                 5.1.2            py37h39e3cac_0
ipython                   7.8.0            py37h39e3cac_0
ipython_genutils          0.2.0                    py37_0
ipywidgets                7.5.1                      py_0
iso8601                   0.1.12                   pypi_0    pypi
isort                     4.3.21                   py37_0
itsdangerous              1.1.0                    py37_0
jdcal                     1.4.1                      py_0
jedi                      0.15.1                   py37_0
jinja2                    2.10.3                     py_0
joblib                    0.13.2                   py37_0
jpeg                      9b                   hb83a4c4_2
json5                     0.8.5                      py_0
jsonschema                3.0.2                    py37_0
jupyter                   1.0.0                    py37_7
jupyter_client            5.3.3                    py37_1
jupyter_console           6.0.0                    py37_0
jupyter_core              4.5.0                      py_0
jupyterlab                1.1.4              pyhf63ae98_0
jupyterlab_server         1.0.6                      py_0
keyring                   18.0.0                   py37_0
kiwisolver                1.1.0            py37ha925a31_0
krb5                      1.16.1               hc04afaa_7
lazy-object-proxy         1.4.2            py37he774522_0
libarchive                3.3.3                h0643e63_5
libcurl                   7.65.3               h2a8f88b_0
libiconv                  1.15                 h1df5818_7
liblief                   0.9.0                ha925a31_2
libpng                    1.6.37               h2a8f88b_0
libsodium                 1.0.16               h9d3ae62_0
libssh2                   1.8.2                h7a1dbc1_0
libtiff                   4.0.10               hb898794_2
libxml2                   2.9.9                h464c3ec_0
libxslt                   1.1.33               h579f668_0
llvmlite                  0.29.0           py37ha925a31_0
locket                    0.2.0                    py37_1
lxml                      4.4.1            py37h1350720_0
lz4-c                     1.8.1.2              h2fa13f4_0
lzo                       2.10                 h6df0209_2
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.1.1            py37he774522_0
matplotlib                3.1.1            py37hc8f65d3_0
mccabe                    0.6.1                    py37_1
menuinst                  1.4.16           py37he774522_0
mistune                   0.8.4            py37he774522_0
mkl                       2019.4                      245
mkl-service               2.3.0            py37hb782905_0
mkl_fft                   1.0.14           py37h14836fe_0
mkl_random                1.1.0            py37h675688f_0
mock                      3.0.5                    py37_0
more-itertools            7.2.0                    py37_0
mpmath                    1.1.0                    py37_0
msgpack-python            0.6.1            py37h74a9793_1
msys2-conda-epoch         20160418                      1
multipledispatch          0.6.0                    py37_0
navigator-updater         0.2.1                    py37_0
nbconvert                 5.6.0                    py37_1
nbformat                  4.4.0                    py37_0
networkx                  2.3                        py_0
nltk                      3.4.5                    py37_0
nose                      1.3.7                    py37_2
notebook                  6.0.1                    py37_0
numba                     0.45.1           py37hf9181ef_0
numexpr                   2.7.0            py37hdce8814_0
numpy                     1.16.5           py37h19fb1c0_0
numpy-base                1.16.5           py37hc3f5095_0
numpydoc                  0.9.1                      py_0
olefile                   0.46                     py37_0
openpyxl                  3.0.0                      py_0
openssl                   1.1.1d               he774522_2
packaging                 19.2                       py_0
pandas                    0.25.1           py37ha925a31_0
pandoc                    2.2.3.2                       0
pandocfilters             1.4.2                    py37_1
parso                     0.5.1                      py_0
partd                     1.0.0                      py_0
path.py                   12.0.1                     py_0
pathlib2                  2.3.5                    py37_0
patsy                     0.5.1                    py37_0
pep8                      1.7.1                    py37_0
pickleshare               0.7.5                    py37_0
pillow                    6.2.0            py37hdc69c19_0
pip                       19.3.1                   pypi_0    pypi
pkginfo                   1.5.0.1                  py37_0
pluggy                    0.13.0                   py37_0
ply                       3.11                     py37_0
powershell_shortcut       0.0.1                         2
prometheus_client         0.7.1                      py_0
prompt_toolkit            2.0.10                     py_0
psutil                    5.6.3            py37he774522_0
py                        1.8.0                    py37_0
py-lief                   0.9.0            py37ha925a31_2
pycodestyle               2.5.0                    py37_0
pycosat                   0.6.3            py37hfa6e2cd_0
pycparser                 2.19                     py37_0
pycrypto                  2.6.1            py37hfa6e2cd_9
pycurl                    7.43.0.3         py37h7a1dbc1_0
pyflakes                  2.1.1                    py37_0
pygments                  2.4.2                      py_0
pylint                    2.4.2                    py37_0
pyodbc                    4.0.27           py37ha925a31_0
pyopenssl                 19.0.0                   py37_0
pyparsing                 2.4.2                      py_0
pyqt                      5.9.2            py37h6538335_2
pyreadline                2.1                      py37_1
pyrsistent                0.15.4           py37he774522_0
pyserial                  3.4                      pypi_0    pypi
pysocks                   1.7.1                    py37_0
pytables                  3.5.2            py37h1da0976_1
pytest                    5.2.1                    py37_0
pytest-arraydiff          0.3              py37h39e3cac_0
pytest-astropy            0.5.0                    py37_0
pytest-doctestplus        0.4.0                      py_0
pytest-openfiles          0.4.0                      py_0
pytest-remotedata         0.3.2                    py37_0
python                    3.7.4                h5263a28_0
python-dateutil           2.8.0                    py37_0
python-libarchive-c       2.8                     py37_13
pytz                      2019.3                     py_0
pywavelets                1.0.3            py37h8c2d366_1
pywin32                   223              py37hfa6e2cd_1
pywinpty                  0.5.5                 py37_1000
pyyaml                    5.1.2            py37he774522_0
pyzmq                     18.1.0           py37ha925a31_0
qt                        5.9.7            vc14h73c81de_0
qtawesome                 0.6.0                      py_0
qtconsole                 4.5.5                      py_0
qtpy                      1.9.0                      py_0
requests                  2.22.0                   py37_0
rope                      0.14.0                     py_0
ruamel_yaml               0.15.46          py37hfa6e2cd_0
scikit-image              0.15.0           py37ha925a31_0
scikit-learn              0.21.3           py37h6288b17_0
scipy                     1.3.1            py37h29ff71c_0
seaborn                   0.9.0                    py37_0
send2trash                1.5.0                    py37_0
serial                    0.0.97                   pypi_0    pypi
setuptools                42.0.2                   pypi_0    pypi
simplegeneric             0.8.1                    py37_2
singledispatch            3.4.0.3                  py37_0
sip                       4.19.8           py37h6538335_0
six                       1.12.0                   py37_0
snappy                    1.1.7                h777316e_3
snowballstemmer           2.0.0                      py_0
sortedcollections         1.1.2                    py37_0
sortedcontainers          2.1.0                    py37_0
soupsieve                 1.9.3                    py37_0
sphinx                    2.2.0                      py_0
sphinxcontrib             1.0                      py37_1
sphinxcontrib-applehelp   1.0.1                      py_0
sphinxcontrib-devhelp     1.0.1                      py_0
sphinxcontrib-htmlhelp    1.0.2                      py_0
sphinxcontrib-jsmath      1.0.1                      py_0
sphinxcontrib-qthelp      1.0.2                      py_0
sphinxcontrib-serializinghtml 1.1.3                      py_0
sphinxcontrib-websupport  1.1.2                      py_0
spyder                    3.3.6                    py37_0
spyder-kernels            0.5.2                    py37_0
sqlalchemy                1.3.9            py37he774522_0
sqlite                    3.30.0               he774522_0
statsmodels               0.10.1           py37h8c2d366_0
sympy                     1.4                      py37_0
tbb                       2019.4               h74a9793_0
tblib                     1.4.0                      py_0
terminado                 0.8.2                    py37_0
testpath                  0.4.2                    py37_0
tk                        8.6.8                hfa6e2cd_0
toolz                     0.10.0                     py_0
tornado                   6.0.3            py37he774522_0
tqdm                      4.36.1                     py_0
traitlets                 4.3.3                    py37_0
unicodecsv                0.14.1                   py37_0
urllib3                   1.24.2                   py37_0
vc                        14.1                 h0510ff6_4
virtualenv                16.7.9                   pypi_0    pypi
vs2015_runtime            14.16.27012          hf0eaf9b_0
wcwidth                   0.1.7                    py37_0
webencodings              0.5.1                    py37_1
werkzeug                  0.16.0                     py_0
wheel                     0.33.6                   py37_0
widgetsnbextension        3.5.1                    py37_0
win_inet_pton             1.1.0                    py37_0
win_unicode_console       0.5                      py37_0
wincertstore              0.2                      py37_0
winpty                    0.4.3                         4
wrapt                     1.11.2           py37he774522_0
xlrd                      1.2.0                    py37_0
xlsxwriter                1.2.1                      py_0
xlwings                   0.15.10                  py37_0
xlwt                      1.3.0                    py37_0
xz                        5.2.4                h2fa13f4_4
yaml                      0.1.7                hc54c509_2
zeromq                    4.3.1                h33f27b4_3
zict                      1.0.0                      py_0
zipp                      0.6.0                      py_0
zlib                      1.2.11               h62dcd97_3
zstd                      1.3.7                h508b16e_0

test3.spec

Electronic Part

unread,
Dec 29, 2019, 12:03:10 AM12/29/19
to kivy-...@googlegroups.com
Here is the error i got. I searched throw the net even add some dlls, still not working


WARNING] [Image       ] Unable to load image <C:\Users\Hamid\AppData\Local\Temp\_MEI61202\kivy_install\data\glsl\default.png>

[CRITICAL] [Window      ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the confi
g) and re-run your app to identify potential causes
sdl2 - Exception: SDL2: Unable to load image
  File "site-packages\kivy\core\__init__.py", line 71, in core_select_lib
  File "site-packages\kivy\core\window\window_sdl2.py", line 152, in __init__
  File "site-packages\kivy\core\window\__init__.py", line 981, in __init__
  File "site-packages\kivy\core\window\window_sdl2.py", line 312, in create_window
  File "site-packages\kivy\core\window\__init__.py", line 1258, in create_window
  File "kivy\graphics\instructions.pyx", line 783, in kivy.graphics.instructions.RenderContext.__init__
  File "site-packages\kivy\core\image\__init__.py", line 561, in __init__
  File "site-packages\kivy\core\image\__init__.py", line 756, in _set_filename
  File "site-packages\kivy\core\image\__init__.py", line 460, in load
  File "site-packages\kivy\core\image\__init__.py", line 223, in __init__
  File "site-packages\kivy\core\image\img_sdl2.py", line 47, in load

[CRITICAL] [App         ] Unable to get a Window, abort.

Elliot Garbus

unread,
Dec 29, 2019, 12:34:36 AM12/29/19
to kivy-...@googlegroups.com

Does the app run properly when you are not under pyinstaller? Glew, kivy and sdl deps are not in your list of packages.

 

The error message says, “ Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes.

 

Have you run with the debug logging enabled? 

Electronic Part

unread,
Dec 29, 2019, 12:42:10 AM12/29/19
to kivy-...@googlegroups.com
I go to the path that my exe is located and by terminal in pycharm and run exe

Elliot Garbus

unread,
Dec 29, 2019, 1:08:38 AM12/29/19
to kivy-...@googlegroups.com
So just to be clear:
The app runs properly when not built with pyinstaller. 
Pyinstaller is creating an exe. 
When the exe is run, it results in the error message below, is that correct?

Look in the dist directory that pyinstaller created. Do you see all of the sdl2 dlls?

Sent from my iPhone

On Dec 28, 2019, at 10:42 PM, Electronic Part <hsiel...@gmail.com> wrote:



Electronic Part

unread,
Dec 29, 2019, 1:13:29 AM12/29/19
to kivy-...@googlegroups.com
yes. the app is working properly. this error is from exe not the app itself

Electronic Part

unread,
Dec 29, 2019, 1:16:19 AM12/29/19
to kivy-...@googlegroups.com
no I don't see any dll. I made the exe by using pyinstaller --onefile test3.py command . I got this error when I tried to execute the exe file 

On Sun, Dec 29, 2019, 09:38 Elliot Garbus <elli...@cox.net> wrote:

Elliot Garbus

unread,
Dec 29, 2019, 1:23:08 AM12/29/19
to kivy-...@googlegroups.com

Try making the file with pyinstaller -spec test3.spec

Electronic Part

unread,
Dec 29, 2019, 2:59:22 AM12/29/19
to kivy-...@googlegroups.com
did not work for me.  can't recognize test3.spec . I am in the same directory 

Elliot Garbus

unread,
Dec 29, 2019, 6:24:42 AM12/29/19
to kivy-...@googlegroups.com
Show the error. Something simple is wrong. 

Sent from my iPad

On Dec 29, 2019, at 12:59 AM, Electronic Part <hsiel...@gmail.com> wrote:



Electronic Part

unread,
Dec 29, 2019, 6:27:52 AM12/29/19
to kivy-...@googlegroups.com
Sure This is what i got. Thanks

(conda_evnv) (kivy_venv) D:\code\final_designe\test>pyinstaller -spec test3.spec
97 INFO: PyInstaller: 3.5
98 INFO: Python: 3.7.4
98 INFO: Platform: Windows-7-6.1.7601-SP1
99 INFO: UPX is not available.
Traceback (most recent call last):
  File "d:\programdata\anaconda3\envs\conda_evnv\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\programdata\anaconda3\envs\conda_evnv\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\ProgramData\Anaconda3\envs\conda_evnv\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "d:\programdata\anaconda3\envs\conda_evnv\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "d:\programdata\anaconda3\envs\conda_evnv\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "d:\programdata\anaconda3\envs\conda_evnv\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "d:\programdata\anaconda3\envs\conda_evnv\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "test3.spec", line 17, in <module>
    noarchive=False)
  File "d:\programdata\anaconda3\envs\conda_evnv\lib\site-packages\PyInstaller\building\build_main.py", line 190, in __init__
    raise ValueError("script '%s' not found" % script)
ValueError: script 'test3.sepc' not found

Elliot Garbus

unread,
Dec 29, 2019, 6:46:01 AM12/29/19
to kivy-...@googlegroups.com
ValueError: script 'test3.sepc' not found

Notice the file extension is spelled wrong. Very odd.
What is in your working dir? Show the file listing.



Sent from my iPad

Elliot Garbus

unread,
Dec 29, 2019, 6:50:51 AM12/29/19
to kivy-...@googlegroups.com
File "test3.spec", line 17, in <module>
    noarchive=False)

It has the file.... is there something Wong near line 17?   

Sent from my iPad

Electronic Part

unread,
Dec 29, 2019, 6:52:47 AM12/29/19
to kivy-...@googlegroups.com
This is line 17

noarchive=False)

On Sun, Dec 29, 2019 at 3:20 PM Elliot Garbus <elli...@cox.net> wrote:
File "test3.spec", line 17, in <module>
    noarchive=False)

It has the file.... is there something Wong near line 17?   

Sent from my iPad

On Dec 29, 2019, at 4:27 AM, Electronic Part <hsiel...@gmail.com> wrote:

File "test3.spec", line 17, in <module>
    noarchive=False)

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Electronic Part

unread,
Dec 29, 2019, 7:02:46 AM12/29/19
to kivy-...@googlegroups.com
Let's start from the beginning . How to make spec file from pyinstaller.

Electronic Part

unread,
Dec 29, 2019, 7:39:26 AM12/29/19
to kivy-...@googlegroups.com
I think something is wrong with kivy and pyinstaller together. I tried all the things you said for a code which is simply print something to the screen and that works without any problem. 
test6.py
test6.spec

Elliot Garbus

unread,
Dec 29, 2019, 10:38:43 AM12/29/19
to Kivy users support

I use pyinstaller all of the time.  I packaged an app on kivy for Windows10 and mac earlier this week.

Pyinstaller is very complex, and the documentation is difficult to understand.  Keep at it – I know you can make it work.


The spec file test6.spec is missing all of the kivy specific code.  Here my working specfile for kivy windows 10 builds.  This should work fine on Windows 7.


try building your exe with this file as is.  Change the name of your app to main.py.  The app name will be wrong, and you won't have the icon file but you can fix that later.  

I use a venv or pipenv  you may have a complicaiton due to your conda install.  It looks like you have  a venv on top of a venv.  


I'd suggest creating a new venv, add kivy and pyintaller, see if you can get things building.  Then either add kivy and pyinstaller to a conda venv, and do a simple build.





On Sunday, December 29, 2019 at 5:39:26 AM UTC-7, Electronic Part wrote:
I think something is wrong with kivy and pyinstaller together. I tried all the things you said for a code which is simply print something to the screen and that works without any problem. 

On Sun, Dec 29, 2019 at 3:32 PM Electronic Part <hsiel...@gmail.com> wrote:
Let's start from the beginning . How to make spec file from pyinstaller.

On Sun, Dec 29, 2019 at 3:22 PM Electronic Part <hsiel...@gmail.com> wrote:
This is line 17

noarchive=False)

On Sun, Dec 29, 2019 at 3:20 PM Elliot Garbus <elli...@cox.net> wrote:
File "test3.spec", line 17, in <module>
    noarchive=False)

It has the file.... is there something Wong near line 17?   

Sent from my iPad

On Dec 29, 2019, at 4:27 AM, Electronic Part <hsiel...@gmail.com> wrote:

File "test3.spec", line 17, in <module>
    noarchive=False)

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
w10.spec

Electronic Part

unread,
Dec 30, 2019, 5:20:38 AM12/30/19
to kivy-...@googlegroups.com
Thanks for your time. Could you please give me list of your packages along with their version in your virtual environment. I made a new conda env. I want to install everything properly 

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/590b807d-70aa-4042-97d7-ec2006c1c025%40googlegroups.com.

Electronic Part

unread,
Dec 30, 2019, 6:35:57 AM12/30/19
to kivy-...@googlegroups.com
Here was my answer. I could solve it for hello world example

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/590b807d-70aa-4042-97d7-ec2006c1c025%40googlegroups.com.

Elliot Garbus

unread,
Dec 30, 2019, 8:46:07 AM12/30/19
to kivy-...@googlegroups.com

Glad you have it running!

 

Just a warning:  The line:

        Tree('examples-path\\demo\\touchtracer\\'),

 

Puts all of your source code in the bundle.  If you don’t want to ship all of your .py files to your users, you would replace this line and put the name and location you want your data files, using the datas[] section of the spec file.

 

From: Electronic Part
Sent: Monday, December 30, 2019 4:35 AM
To: kivy-...@googlegroups.com
Subject: Re: [kivy-users] Tried to make an exe file

 

Here was my answer. I could solve it for hello world example

Electronic Part

unread,
Dec 31, 2019, 2:02:23 AM12/31/19
to kivy-...@googlegroups.com
Thanks you so much.Just as last questions, 1.How cover .kv imports. To understand my question, please look at the files i have attached. In test.kv i have imported #:import get_display bidi.algorithm.get_display. Once i make the exe file i am getting this error:Unable to import package 'bidi.algorithm.get_display'.2. How to add .kv file to .spec file . I really appreciate your help


test.py
test.kv

Electronic Part

unread,
Dec 31, 2019, 5:49:43 AM12/31/19
to kivy-...@googlegroups.com
I found an answer for adding .kv file. So, I change test.py to this. The rest of the code is the same. I still do't have any answer for my first question.

try:
with open(dirpath+"/test.kv", encoding='utf-8') as f: # Note the name of the .kv
kv = Builder.load_string(f.read())
except:
with open(current_folder_path+"/test.kv", encoding='utf-8') as f: # Note the name of the .kv

Elliot Garbus

unread,
Dec 31, 2019, 7:06:57 AM12/31/19
to kivy-...@googlegroups.com

To add a kv file to Pyinstaller, you add the file to the datas list, and tell Pyinstaller where you would like to put it.  You can also list images and any other data files.

 

For example:

datas=[('../*.kv', '.'), ('../Images/*.png', './Images'), ( '../*.mep', '.')],

 

I have my .spec file in a directory below my project file, and run pyinstaller from that directory.  The tuples tell pyinstaller to get all the kv files and put them in the current working directory.  I do not have to make any changes to my python code.

https://pythonhosted.org/PyInstaller/spec-files.html#adding-data-files

 

For files that are imported by KV, I simply add an additional import to python code.  This allows Pyinstaller to find the file, and does not require any change to the Pyinstaller file.  This has allowed me to use the same pyinstaller file with only minor modifications.

 

So if a .kv file includes:

#:import pathlib pathlib

 

In a .py file I would add:

Import pathlib               # required for pyinstaller  (The comment is a reminder why the import is included.

 

An alternative would be to add the imports to the hidden imports list in pyinstaller

https://pythonhosted.org/PyInstaller/when-things-go-wrong.html?highlight=hidden#listing-hidden-imports

 

From: Electronic Part
Sent: Tuesday, December 31, 2019 3:49 AM
To: kivy-...@googlegroups.com
Subject: Re: [kivy-users] Tried to make an exe file

 

I found an answer for adding .kv file. So, I change test.py to this. The rest of the code is the same. I still do't have any answer for my first question.

--

You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Electronic Part

unread,
Dec 31, 2019, 7:15:30 AM12/31/19
to kivy-...@googlegroups.com
Thanks. About this line
datas=[('../*.kv', '.'), ('../Images/*.png', './Images'), ( '../*.mep', '.')],

I don't know exactly what i have to out as a path for ../*.please give me an example

Elliot Garbus

unread,
Dec 31, 2019, 7:23:40 AM12/31/19
to kivy-...@googlegroups.com

If all your files are in the same directory and you put your spec file in that directory, then your data file would be:

 

datas=[('*.kv', '.'), ('Images/*.png', './Images'), ( '*.mep', '.')],

 

../ means go up one level in the directory hierarchy.

 

You can go to the command line and (on windows) tyoe:

dir ../

and you will see the directory of the parent directory

 

or simply ‘.’ Is the current working directory; ‘..’ is the parent directory

Electronic Part

unread,
Jan 1, 2020, 8:09:59 AM1/1/20
to kivy-...@googlegroups.com
Now i have the exe file. I want to make installation file. I followed this video. 


Now my question is why i am getting this error after installation and after running that. Should i add anything else?

[CRITICAL] [App         ] Unable to get a Window, abort.   

Elliot Garbus

unread,
Jan 1, 2020, 3:03:08 PM1/1/20
to kivy-...@googlegroups.com
When you run the exe under the dist directory does it run properly?

When you use the Innosoft installer wizard you need to add the folder that contains the exe and all of the files and sub folders. 
You select the directory and the. It is a check bos to include sub folders. 

Sent from my iPhone

On Jan 1, 2020, at 6:09 AM, Electronic Part <hsiel...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages