Pls HELP: OSC error in Kivy Python on Windows

541 views
Skip to first unread message

Cecile Dong

unread,
Aug 14, 2016, 11:28:24 PM8/14/16
to Kivy users support
I installed all Kivy dependencies according to their website but seeing the error below when I test run. It seems that the issue is about OSC but I couldn't find OSC to be installed in Python. Anyone can help?


PS C:\python27\game> python game.py
[INFO   ] [Logger      ] Record log in C:\Users\Cecile.CecileD\.kivy\logs\kivy_16-08-14_9.txt
[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     ] 193 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
sdl2 - ImportError: No module named OSC
  File "C:\Python27\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Python27\lib\site-packages\kivy\core\window\window_sdl2.py", line 26, in <module>
    from kivy.input.provider import MotionEventProvider
  File "C:\Python27\lib\site-packages\kivy\input\__init__.py", line 33, in <module>
    import kivy.input.providers
  File "C:\Python27\lib\site-packages\kivy\input\providers\__init__.py", line 13, in <module>
    import kivy.input.providers.tuio
  File "C:\Python27\lib\site-packages\kivy\input\providers\tuio.py", line 42, in <module>
    from kivy.lib import osc
  File "C:\Python27\lib\site-packages\kivy\lib\osc\__init__.py", line 23, in <module>
    from .OSC import *

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

Eric Sellon

unread,
Aug 15, 2016, 1:24:32 AM8/15/16
to Kivy users support
Please post the output of "pip list" to aid in solving this problem.
Message has been deleted

Cecile Dong

unread,
Aug 15, 2016, 9:07:07 PM8/15/16
to Kivy users support
Here is the full list

PS C:\python27> pip list
Cython (0.24.1)
distribute (0.7.3)
Django (1.9.2)
django-ckeditor (5.0.3)
django-markdown (0.8.4)
docutils (0.12)
kivy (1.9.1)
Kivy-Garden (0.1.4)
kivy.deps.glew (0.1.4)
kivy.deps.gstreamer (0.1.5)
kivy.deps.sdl2 (0.1.12)
lpthw.web (1.1)
lxml (3.4.4)
Markdown (2.6.6)
mingwpy (0.1.0b3)
nose (1.3.7)
pip (8.1.2)
pygame (1.9.2b1)
Pygments (2.1.3)
pyOSC (0.3.5b5294)
pypiwin32 (219)
python-osc (1.6)
pytils (0.3)
requests (2.11.0)
setuptools (25.2.0)
six (1.10.0)
tools (0.1.9)
virtualenv (13.1.2)
wheel (0.29.0)

Eric Sellon

unread,
Aug 15, 2016, 9:48:39 PM8/15/16
to Kivy users support
I tried installing some of the packages that you have that I lack, but did not see any issues. So I suggest you try reinstalling to see if it "repairs" your install. You don't need to uninstall, just do the pip install commands with -U --force-reinstall. Like this:
pip install -U --force-reinstall docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew

Good luck.


Cecile Dong

unread,
Aug 16, 2016, 8:53:42 PM8/16/16
to Kivy users support
Thanks, Eric.

I tried the reinstall as you suggested but it gave me some error messages as highlighted error. With that, I tried to run the game.py I created and the "Unable to get a Window" error is still there. Any suggestions?

PS C:\python27> pip install -U --force-reinstall docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
Collecting docutils
Collecting pygments
  Using cached Pygments-2.1.3-py2.py3-none-any.whl
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
Installing collected packages: docutils, pygments, pypiwin32, kivy.deps.sdl2, kivy.deps.glew
  Found existing installation: docutils 0.12
    Uninstalling docutils-0.12:
      Successfully uninstalled docutils-0.12
  Found existing installation: Pygments 2.1.3
    Uninstalling Pygments-2.1.3:
      Successfully uninstalled Pygments-2.1.3
  Found existing installation: pypiwin32 219
    Uninstalling pypiwin32-219:
      Successfully uninstalled pypiwin32-219
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\pip\commands\install.py", line 317, in run
    prefix=options.prefix_path,
  File "c:\python27\lib\site-packages\pip\req\req_set.py", line 753, in install
    requirement.commit_uninstall()
  File "c:\python27\lib\site-packages\pip\req\req_install.py", line 755, in commit_uninstall
    self.uninstalled.commit()
  File "c:\python27\lib\site-packages\pip\req\req_uninstall.py", line 142, in commit
    rmtree(self.save_dir)
  File "c:\python27\lib\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "c:\python27\lib\site-packages\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
  File "c:\python27\lib\site-packages\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "c:\python27\lib\site-packages\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 102, in rmtree
    onerror=rmtree_errorhandler)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 114, in rmtree_errorhandler
    func(path)
WindowsError: [Error 5] Access is denied: 'c:\\users\\cecile~1.cec\\appdata\\local\\temp\\pip-tjuszh-uninstall\\python27
\\lib\\site-packages\\pywin32_system32\\pywintypes27.dll'

PS C:\python27> cd c:\python27\game
PS C:\python27\game> python game.py
[INFO   ] [Logger      ] Record log in C:\Users\Cecile.CecileD\.kivy\logs\kivy_16-08-16_0.txt
[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     ] 193 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
sdl2 - ImportError: No module named OSC
  File "C:\Python27\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Python27\lib\site-packages\kivy\core\window\window_sdl2.py", line 26, in <module>
    from kivy.input.provider import MotionEventProvider
  File "C:\Python27\lib\site-packages\kivy\input\__init__.py", line 33, in <module>
    import kivy.input.providers
  File "C:\Python27\lib\site-packages\kivy\input\providers\__init__.py", line 13, in <module>
    import kivy.input.providers.tuio
  File "C:\Python27\lib\site-packages\kivy\input\providers\tuio.py", line 42, in <module>
    from kivy.lib import osc
  File "C:\Python27\lib\site-packages\kivy\lib\osc\__init__.py", line 23, in <module>
    from .OSC import *

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

Eric Sellon

unread,
Aug 16, 2016, 10:24:40 PM8/16/16
to Kivy users support
The fact that your uninstall failed is a little disturbing. Try running PS or cmd as administrator. Run:
    • pip install -U --force-reinstall docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
    • pip install -U --force-reinstall kivy
    There really needs to be no errors in the uninstall and the reinstall to be confident that it all works. Also before you do this, make sure that the Python 2.7 compiler is installed. It can be found at: https://www.microsoft.com/en-us/download/details.aspx?id=44266 (It will show up in the Control Panel -> Programs and Features as: Microsoft Visual C++ Compiler Package for Python 2.7).

    The Window provider should be SDL2, which is failing to initialize because of the trouble with importing OSC which comes with Kivy (or is supplied in one of the dependencies). Also if you're running 2.7.9 or earlier, it wouldn't hurt to update to the latest in the 2.7 line.

    Hope that helps.

    Cecile Dong

    unread,
    Aug 17, 2016, 10:12:25 PM8/17/16
    to Kivy users support
    Thanks, Eric. Tried all the following and ran the game.py again. This time, a new error below appears?? Not sure if I should give up on Kivy and go find another solution now....

    PS C:\python27\game> python game.py
    [INFO              ] [Logger      ] Record log in C:\Users\Cecile.CecileD\.kivy\logs\kivy_16-08-17_4.txt
    [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 "game.py", line 1, in <module>
         from kivy.app import App
       File "C:\Python27\lib\site-packages\kivy\app.py", line 319, in <module>
         from kivy.base import runTouchApp, stopTouchApp
       File "C:\Python27\lib\site-packages\kivy\base.py", line 31, in <module>
         from kivy.lang import Builder
       File "C:\Python27\lib\site-packages\kivy\lang\__init__.py", line 860, in <module>
         from kivy.lang.builder import Observable, Builder, BuilderBase, BuilderException
       File "C:\Python27\lib\site-packages\kivy\lang\builder.py", line 17, in <module>
         from kivy.lang.parser import Parser, ParserException, _handlers, global_idmap,\
       File "C:\Python27\lib\site-packages\kivy\lang\parser.py", line 22, in <module>
         from kivy.utils import rgba
     ImportError: cannot import name rgba

    Cyril Coelho

    unread,
    Oct 14, 2017, 3:59:18 PM10/14/17
    to Kivy users support
    if you use anaconda read this:

    remove all:
    python -m pip uninstall kivy
    conda uninstall --force kivy 

    find the package for your system:
    anaconda search -t conda kivy

    for exemple, on mac is akode package.
    then:
    conda install -c akode kivy=1.9.1
    Reply all
    Reply to author
    Forward
    0 new messages