[MacPorts] #42406: Importing sdl2 in python3.3 gives PYSDL2_DLL_PATH: unset
#42406: Importing sdl2 in python3.3 gives PYSDL2_DLL_PATH: unset -----------------------------+-------------------------------- Reporter: russell.jones@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: | Port: py33-sdl2 -----------------------------+-------------------------------- I guess I could set this manually, but shouldn't it be set by macports, e.g. in the module? {{{ $ ipython3-3.3 Python 3.3.3 (default, Nov 25 2013, 20:12:26) ... In [1]: import sdl2 --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-1-8ce3838bd765> in <module>() ----> 1 import sdl2 /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3 /site-packages/sdl2/__init__.py in <module>() 1 """SDL2 wrapper package""" ----> 2 from .dll import get_dll_file, _bind 3 from ctypes import c_int as _cint 4 5 from .audio import * /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3 /site-packages/sdl2/dll.py in <module>() 105 dll = _DLL("SDL2", ["SDL2", "SDL2-2.0"], os.getenv("PYSDL2_DLL_PATH")) 106 except RuntimeError as exc: --> 107 raise ImportError(exc) 108 109 def nullfunc(*args): ImportError: could not find any library for SDL2 (PYSDL2_DLL_PATH: unset) In [2]: }}} libsdl2* are installed. Russell -- Ticket URL: <https://trac.macports.org/ticket/42406> MacPorts <http://www.macports.org/> Ports system for OS X
#42406: Importing sdl2 in python3.3 gives PYSDL2_DLL_PATH: unset ------------------------------+---------------------- Reporter: russell.jones@… | Owner: jmr@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: py33-sdl2 | ------------------------------+---------------------- Changes (by jmr@…): * cc: jmr@… (removed) * cc: jwa@… (added) * owner: macports-tickets@… => jmr@… * status: new => assigned Comment: Hmm, yeah. `import ctypes.util; ctypes.util.find_library('SDL2')` returns None in python3.3 (as opposed to '/opt/local/lib/libSDL2.dylib’ in 2.7). Not sure if ctypes needs fixing (to search in ${prefix}/lib for example) or if I should just hardcode the path to the lib in the python code. -- Ticket URL: <https://trac.macports.org/ticket/42406#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#42406: Importing sdl2 in python3.3 gives PYSDL2_DLL_PATH: unset ------------------------------+-------------------- Reporter: russell.jones@… | Owner: jmr@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: fixed | Keywords: Port: py33-sdl2 | ------------------------------+-------------------- Changes (by jmr@…): * status: assigned => closed * resolution: => fixed Comment: Fixed in r118683. It complains that a bunch of functions are missing at import time, but the examples seem to work fine. I think there’s still probably a good case for having our ctypes look in ${prefix}/lib all the time. -- Ticket URL: <https://trac.macports.org/ticket/42406#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts