Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find any valuable Window provider at all! #3957

Closed
pierwszywolny opened this issue Feb 1, 2016 · 17 comments
Closed

Unable to find any valuable Window provider at all! #3957

pierwszywolny opened this issue Feb 1, 2016 · 17 comments

Comments

@pierwszywolny
Copy link

Hi
I have installed kivy on two PCs (Win7, python2.7) folowing https://kivy.org/docs/installation/installation-windows.html instructions.
On first one no problem to run examples but I have been fighting with second one for over 4 hours.

Problem is that after kivy installation my sys path does not contain path to any SDL2 dlls required to load *.png
I have added C:\Python27\share\gstreamer\bin to sys path and now is ok.

I am reporting it as crucial problem because it could easly alienate potential users

@dessant dessant added Platform: Windows Component: Packaging Pyinstaller, Kivy.app, end user project packaging labels Feb 6, 2016
@dessant
Copy link
Contributor

dessant commented Feb 6, 2016

@matham ping. 👅

@matham
Copy link
Member

matham commented Feb 6, 2016

There's not enough information here to understand what the issue is, especially without a traceback of the issue and full detail on how it was installed. For example, what does it means that the system PATH does not contain sdl2 dlls? Why should it? It's automatically added to the path when kivy is imported.if kivy.deps.sdl2 was installed. gstreamer should be unrelated to sdl2 and adding it to the path should not affect this.

@pierwszywolny
Copy link
Author

Hi
This is log when I remove C:\Python27\share\gstreamer\bin from sys PATH

[INFO ] Kivy: v1.9.2-dev0
[INFO ] Python: v2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
[INFO ] Factory: 179 symbols loaded
[INFO ] Image: Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] OSC: using for socket
[INFO ] Window: Provider: sdl2
[INFO ] GL: GLEW initialization succeeded
[INFO ] GL: OpenGL version <3.3.0 - Build 8.15.10.2626>
[INFO ] GL: OpenGL vendor
[INFO ] GL: OpenGL renderer <Intel(R) HD Graphics 4000>
[INFO ] GL: OpenGL parsed version: 3, 3
[INFO ] GL: Shading version <3.30 - Intel Build 8.15.10.2626>
[INFO ] GL: Texture max size <8192>
[INFO ] GL: Texture max units <16>
[INFO ] Shader: fragment shader:
[INFO ] Shader: vertex shader:
[INFO ] Shader: program:
[WARNING ] Image: Unable to load image <C:\Python27\lib\site-packages\kivy\data\glsl\default.png>
[CRITICAL ] Window: Unable to find any valuable Window provider at all!
sdl2 - Exception: SDL2: Unable to load image
File "C:\Python27\lib\site-packages\kivy\core__init__.py", line 67, in core_select_lib
cls = cls()
File "C:\Python27\lib\site-packages\kivy\core\window\window_sdl2.py", line 138, in init
super(WindowSDL, self).init()
File "C:\Python27\lib\site-packages\kivy\core\window__init__.py", line 726, in init
self.create_window()
File "C:\Python27\lib\site-packages\kivy\core\window\window_sdl2.py", line 258, in create_window
super(WindowSDL, self).create_window()
File "C:\Python27\lib\site-packages\kivy\core\window__init__.py", line 901, in create_window
self.render_context = RenderContext()
File "kivy\graphics\instructions.pyx", line 756, in kivy.graphics.instructions.RenderContext.init (kivy\graphics\instructions.c:10729)
File "C:\Python27\lib\site-packages\kivy\core\image__init__.py", line 512, in init
self.filename = arg
File "C:\Python27\lib\site-packages\kivy\core\image__init__.py", line 700, in set_filename
mipmap=self.mipmap, nocache=self.nocache)
File "C:\Python27\lib\site-packages\kivy\core\image__init
.py", line 430, in load
im = loader(filename, **kwargs)
File "C:\Python27\lib\site-packages\kivy\core\image__init
_.py", line 198, in init
self._data = self.load(filename)
File "C:\Python27\lib\site-packages\kivy\core\image\img_sdl2.py", line 42, in load
raise Exception('SDL2: Unable to load image')

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

I have noticed that default.png can't be loaded
Image: Unable to load image C:\Python27\lib\site-packages\kivy\data\glsl\default.png

Little bit googling and I found info that sdl2 can't load libpng16-16.dll bacause can't find it
http://stackoverflow.com/questions/21472958/sdl-image-img-load-fails-on-png

I found libpng16-16.dll in C:\Python27\share\gstreamer\bin
then
set PATH=C:\Python27\share\gstreamer\bin;%PATH%
and problem was resolved temporary

Now the most mystery - on my second laptop I didn't add C:\Python27\share\gstreamer\bin to the path and everything works properly - can't explain that.

This looks pretty similar:

@matham
Copy link
Member

matham commented Feb 8, 2016

On the computer that doesn't work, have you ever used kivy before? If so, have you changed the system paths? The wheels may not work if you have previous dlls on the PATH. You have to make sure that the PATH is clean with no python/kivy stuff added to it or at least no previous kivy dlls is on the path. Then it should work.

If it still doesn't work, can you completely uninstall kivy and all the deps and then reinstall? But tell us the exact command you use to install. Infact, can you post the result of running the following code:

import sys
import kivy
print(sys.path)

@matham matham removed the Component: Packaging Pyinstaller, Kivy.app, end user project packaging label Feb 8, 2016
@pierwszywolny
Copy link
Author

On the computer that doesn't work, have you ever used kivy before?

Don't know

If so, have you changed the system paths

Don't know

Bacause of my answers I decided to fully reinstal kivy but before I run requested program:

D:\Kivy\kivy\examples\tutorials\pong
D:\Kivy\kivy\examples
C:\Python27\python27.zip
C:\Python27\DLLs
C:\Python27\lib
C:\Python27\lib\plat-win
C:\Python27\lib\lib-tk
C:\Python27
C:\Python27\lib\site-packages
C:\Python27\lib\site-packages\win32
C:\Python27\lib\site-packages\win32\lib
C:\Python27\lib\site-packages\Pythonwin
C:\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\Python27\lib\site-packages\kivy\modules
C:\Users\AG\.kivy\mods

Then I uninstall kivy:

  1. pip uninstall kivy
    Successfully uninstalled Kivy-1.9.1
  2. Manualy removed from site packages everything containing kivy
  3. I have installed all again acording instruction:
D:\Kivy\kivy\examples\tutorials\pong>python -m pip install --upgrade pip wheel setuptools
Requirement already up-to-date: pip in c:\python27\lib\site-packages
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 69kB 650kB/s
Collecting setuptools
  Downloading setuptools-20.0-py2.py3-none-any.whl (472kB)
    100% |################################| 475kB 130kB/s
Installing collected packages: wheel, setuptools
  Found existing installation: wheel 0.26.0
    Uninstalling wheel-0.26.0:
      Successfully uninstalled wheel-0.26.0
  Found existing installation: setuptools 19.6.1
    Uninstalling setuptools-19.6.1:
      Successfully uninstalled setuptools-19.6.1
Successfully installed setuptools-20.0 wheel-0.29.0

D:\Kivy\kivy\examples\tutorials\pong>python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew kivy.deps.gstreamer --extra-index-url https
://kivy.org/downloads/packages/simple
Requirement already satisfied (use --upgrade to upgrade): docutils in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): pygments in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): pypiwin32 in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): kivy.deps.sdl2 in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): kivy.deps.glew in c:\python27\lib\site-packages
Collecting kivy.deps.gstreamer
  Downloading https://www.googledrive.com/host/0B1_HB9J8mZepNzZ5aW91Q0tJU2s/kivy.deps.gstreamer-0.1.5-cp27-none-win32.whl
     - 93.2MB 6.8MB/s
Installing collected packages: kivy.deps.gstreamer
Successfully installed kivy.deps.gstreamer-0.1.5

D:\Kivy\kivy\examples\tutorials\pong>python -m pip install kivy
Collecting kivy
  Using cached Kivy-1.9.1-cp27-none-win32.whl
Collecting Kivy-Garden>=0.1.4 (from kivy)
Requirement already satisfied (use --upgrade to upgrade): requests in c:\python27\lib\site-packages (from Kivy-Garden>=0.1.4->kivy)
Installing collected packages: Kivy-Garden, kivy
Successfully installed Kivy-Garden-0.1.4 kivy-1.9.1

But problem remains but with different callstack

import sys
import kivy
for p in sys.path:
    print p
D:\Kivy\kivy\examples\tutorials\pong
D:\Kivy\kivy\examples
C:\Python27\python27.zip
C:\Python27\DLLs
C:\Python27\lib
C:\Python27\lib\plat-win
C:\Python27\lib\lib-tk
C:\Python27
C:\Python27\lib\site-packages
C:\Python27\lib\site-packages\win32
C:\Python27\lib\site-packages\win32\lib
C:\Python27\lib\site-packages\Pythonwin
C:\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\Python27\lib\site-packages\kivy\modules
C:\Users\AG\.kivy\mods
[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
[INFO              ] [Factory     ] 179 symbols loaded
 Traceback (most recent call last):
   File "D:/Kivy/kivy/examples/tutorials/pong/main.py", line 4, in <module>
     from kivy.app import App
   File "C:\Python27\lib\site-packages\kivy\app.py", line 327, in <module>
     from kivy.uix.widget import Widget
   File "C:\Python27\lib\site-packages\kivy\uix\widget.py", line 219, in <module>
     from kivy.graphics import (
   File "C:\Python27\lib\site-packages\kivy\graphics\__init__.py", line 89, in <module>
     from kivy.graphics.instructions import Callback, Canvas, CanvasBase, \
 ImportError: DLL load failed: The specified module could not be found.

@matham
Copy link
Member

matham commented Feb 8, 2016

From the pip output:

D:\Kivy\kivy\examples\tutorials\pong>python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew kivy.deps.gstreamer --extra-index-url https
://kivy.org/downloads/packages/simple
Requirement already satisfied (use --upgrade to upgrade): docutils in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): pygments in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): pypiwin32 in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): kivy.deps.sdl2 in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): kivy.deps.glew in c:\python27\lib\site-packages

It says that sdl2 and glew were already installed. You probably had an older version. Make sure you remove these as well, i.e. all the kivy.deps.* packages and then reinstall.

@pierwszywolny
Copy link
Author

I had a problem during instalation of kivy.deps.gstreamer twice.
I killed 4 orphant python.exe then I was able to install it.
That is why you have seen 'Requirement already satisfied' I suppose

Now I did following:
pip uninstall kivy.deps.sdl2 kivy.deps.glew kivy.deps.gstreamer
pip uninstall kivy
pip uninstall Kivy-Garden

manual remove (don't know If I should)
kivy.deps.glew-0.1.4-py2.7-nspkg.pth
kivy.deps.sdl2-0.1.12-py2.7-nspkg.pth

after that my windows search didn't find kivy at all

pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew kivy.deps.gstreamer --extra-index-url https://kivy.org/downloads/package
s/simple/
Requirement already satisfied (use --upgrade to upgrade): docutils in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): pygments in c:\python27\lib\site-packages
Collecting pypiwin32
Using cached pypiwin32-219-cp27-none-win32.whl
Collecting kivy.deps.sdl2
Using cached kivy.deps.sdl2-0.1.12-cp27-none-win32.whl
Collecting kivy.deps.glew
Using cached kivy.deps.glew-0.1.4-cp27-none-win32.whl
Collecting kivy.deps.gstreamer
Downloading https://www.googledrive.com/host/0B1_HB9J8mZepNzZ5aW91Q0tJU2s/kivy.deps.gstreamer-0.1.5-cp27-none-win32.whl
- 93.1MB 10.2MB/s
Installing collected packages: pypiwin32, kivy.deps.sdl2, kivy.deps.glew, kivy.deps.gstreamer
Successfully installed kivy.deps.glew-0.1.4 kivy.deps.gstreamer-0.1.5 kivy.deps.sdl2-0.1.12 pypiwin32-219

pip install kivy
Collecting kivy
Using cached Kivy-1.9.1-cp27-none-win32.whl
Collecting Kivy-Garden>=0.1.4 (from kivy)
Requirement already satisfied (use --upgrade to upgrade): requests in c:\python27\lib\site-packages (from Kivy-Garden>=0.1.4->kivy)
Installing collected packages: Kivy-Garden, kivy
Successfully installed Kivy-Garden-0.1.4 kivy-1.9.1

known result:
[WARNING ] [Image ] Unable to load image <C:\Python27\lib\site-packages\kivy\data\glsl\default.png>

Sorry but I can't remove kivy better it is too complex for me at this stage

@matham
Copy link
Member

matham commented Feb 9, 2016

Well, at this point it should work, and I'm not aware of other systems with similar issues using the latest deps. The only possibilities that I can think for causing this is that you have some leftover dlls from a previous portable kivy package. Otherwise, I'm not sure. If you want to try a few things, can you post the output of:

import os
for f in os.environ['PATH'].split(';'):
    print f
import kivy
for f in os.environ['PATH'].split(';'):
    print f

That should tell us if the PATH is messed up and has locations that should not be there or if the deps are adding the wrong paths. Ideally, we'd see that share/sdl2/bin and share/glew/bin are added to the path after the import.

The best tool to investigate this kind of problem is dependency walker. That will tell you exactly which dll it cannot find, if you're willing to investigate further. To use it, make sure you start it from a env which has the same PATH as the one that runs python after the kivy import. I.e. from python import kivy and then copy the value of os.environ['PATH']. Use this value and set your PATH to that value, i.e. from the command line do set PATH=val. Then, from that same command line start dependency walker. Just do it by changing the current directory to the folder where you extracted dependency walker (cd ...). Then start it with depends.exe.

Now, from the file menu there browse to the kivy installation and select the kivy/graphics/texture.pyd file. After a moment the program will tell you which dlls are missing etc. Save the report and upload it as a gist.

@pierwszywolny
Copy link
Author

due to lack of time I made just one PATH test.

in cmd I cleanup my huge sys PATH
I have just made set PATH=c:\Python27 and now I am able to run pong :)

  • path looks exactly as you mentioned
  • further investigations later
D:\Kivy\kivy\examples\tutorials\pong>python.exe sd.py
c:\python27
c:\python27\lib\site-packages\pywin32_system32
[INFO              ] [Logger      ] Record log in C:\Users\agorszko\.kivy\logs\kivy_16-02-10_2.txt
[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
c:\python27
c:\python27\lib\site-packages\pywin32_system32
c:\python27\share\glew\bin
c:\python27\share\gstreamer\bin
c:\python27\share\sdl2\bin
``

@matham
Copy link
Member

matham commented Feb 12, 2016

In that case I'll close it, because it's something wrong with the PATH on that system. Your original PATH likely included a location with old sdl2/gstreamer dlls which caused this. Cleaning the PATH should fix this.

@matham matham closed this as completed Feb 12, 2016
@pierwszywolny
Copy link
Author

If you want me to continue investigation we have to wait because I am out
of office next week. I removed one by one paths from PATH to find out which
one cause problem. Kivy works perfectly till i add git to PATH, then stóp
working.

If you think that prb exist only with my PC then close issue to not waste
more time.
Thx for help.
12 lut 2016 19:55 "matham" notifications@github.com napisał(a):

In that case I'll close it, because it's something wrong with the PATH on
that system. Your original PATH likely included a location with old
sdl2/gstreamer dlls which caused this. Cleaning the PATH should fix this.


Reply to this email directly or view it on GitHub
#3957 (comment).

@matham
Copy link
Member

matham commented Feb 12, 2016

Well, if it's a problem with e.g. git, which is a common program and not specific to your system, it's worth to investigate more. However, so far we haven't gotten similar issues from other people. So if you have time, sure, investigate further.

Where did you get git from?

@pierwszywolny
Copy link
Author

Git 99% comes from official download page.
Then lets do that way. Next Wednesday I will post dependency walker output
as requested.
You can review it and decide close or not our issue.

2016-02-12 20:22 GMT+01:00 matham notifications@github.com:

Well, if it's a problem with e.g. git, which is a common program and not
specific to your system, it's worth to investigate more. However, so far we
haven't gotten similar issues from other people. So if you have time, sure,
investigate further.

Where did you get git from?


Reply to this email directly or view it on GitHub
#3957 (comment).

@matham
Copy link
Member

matham commented Feb 12, 2016

Ok, great!

@pierwszywolny
Copy link
Author

Hi, here is my gist
https://gist.github.com/pierwszywolny/c99777c12dd95ec83f65

git causing problems

C:\Program Files (x86)\Git\bin>git --version
git version 1.9.5.msysgit.1

@compucen
Copy link

compucen commented Jul 5, 2016

In windows if i rename libz.dll in "C:\Program Files (x86)\git\bin;" or completely remove that dir from PATH it works fine.
Hope it helps.

@melassa
Copy link

melassa commented Oct 11, 2016

I have the same problem in Windows 7 with another program. It is gnuwin32. The dll zlib1.dll in the path under gnuwin32/bin stop kivy. I must remove/rename the dll library or change the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants