1. Marcus von Appen
  2. py-sdl2
  3. Issues
Issue #63 wontfix

Windows - PYSDL2_DLL_PATH does not work

mungewell
created an issue

Following the instructions: http://pysdl2.readthedocs.org/en/latest/integration.html#using-different-sdl2-versions

I can set the 'PYSDL2_DLL_PATH' enviroment variable to point to the location of 'SDL2.dll', however this does not appear to work (using Win7, 32bit, with native python).

'SDL2.0.3-win32-x86.zip' downloaded from libsdl.org.

c:\cygwin\home\swood\contrust_test\PySDL2-0.9.2>"c:\Program Files\Python27\pytho
n.exe" examples\pong.py
Traceback (most recent call last):
  File "examples\pong.py", line 3, in <module>
    import sdl2
  File "c:\Program Files\Python27\lib\site-packages\sdl2\__init__.py", line 2, i
n <module>
    from .dll import get_dll_file, _bind
  File "c:\Program Files\Python27\lib\site-packages\sdl2\dll.py", line 107, in <
module>
    raise ImportError(exc)
ImportError: could not find any library for SDL2 (PYSDL2_DLL_PATH: "C:\Program F
iles\SDL2")

c:\cygwin\home\swood\contrust_test\PySDL2-0.9.2>set PYSDL2_DLL_PATH="C:\Program
Files\SDL2"

c:\cygwin\home\swood\contrust_test\PySDL2-0.9.2>dir %PYSDL2_DLL_PATH%
 Volume in drive C is OS
 Volume Serial Number is FAA5-DD4B

 Directory of C:\Program Files\SDL2

05/27/2014  12:44 PM    <DIR>          .
05/27/2014  12:44 PM    <DIR>          ..
05/27/2014  12:41 PM               432 README-SDL.txt
05/27/2014  12:41 PM         1,007,104 SDL2.dll
               2 File(s)      1,007,536 bytes
               2 Dir(s)  26,144,501,760 bytes free

c:\cygwin\home\swood\contrust_test\PySDL2-0.9.2>"c:\Program Files\Python27\pytho
n.exe" examples\pong.py
Traceback (most recent call last):
  File "examples\pong.py", line 3, in <module>
    import sdl2
  File "c:\Program Files\Python27\lib\site-packages\sdl2\__init__.py", line 2, i
n <module>
    from .dll import get_dll_file, _bind
  File "c:\Program Files\Python27\lib\site-packages\sdl2\dll.py", line 107, in <
module>
    raise ImportError(exc)
ImportError: could not find any library for SDL2 (PYSDL2_DLL_PATH: "C:\Program F
iles\SDL2")

However if I copy the 'SDL2.dll' to somewhere else (ie. on the %PATH%), then it does work.

c:\cygwin\home\swood\contrust_test\PySDL2-0.9.2>"c:\Program Files\Python27\pytho
n.exe" examples\pong.py
Using software rendering

Comments (4)

  1. Log in to comment