sh: sdl2-config: command not found
Traceback (most recent call last):
File "setup.py", line 29, in <module>
parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
File "/Users/Glazed/Desktop/pygame_sdl2/setuplib.py", line 79, in parse_cflags
output = subprocess.check_output(command, universal_newlines=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['sh', '-c', 'sdl2-config --cflags']' returned non-zero exit status 127
I Googled this error and found a discussion on Reddit where someone had the same error as me (http://www.reddit.com/r/pygame/comments ... l2/cq3pt3d) However, the reply was 'you need to install pygame_SDL2'. Well, that was very unhelpful, seeing as that I'm trying to do that >_<
Any help with getting this to work would be appreciated. I'm unable to run RenPy for development purposes because of it.
Ah, so SDL2 != pygame_SDL2? I seemed to be going into a loop with the documentation, thinking one was the other, but was coming up with the same error.
I am attempting to build via the terminal/bash.
Thanks for clarifying!
I'm building on Mac. I'm using the latest nightly build of RenPy (I made sure I selected the one at the bottom of the list) and downloaded the latest version of pygame_sdl2 from renpy/pygame_sdl2 on github.
I'd suggest trying to use something like brew to install the various dependencies (if you can keep track of them as you do, I can update the docs). I think you should probably use the brew-provided python, rather than the apple on.
Supporting creators since 2004 (When was the last time you backed up your game?)
Collecting build-essential
/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Could not find a version that satisfies the requirement build-essential (from versions: )
No matching distribution found for build-essential
Last edited by Glazed Donuts on Fri Apr 17, 2015 10:16 pm, edited 1 time in total.
My Google searches keep coming up with the build-install equivalent pointing to me having to download the XCode app, which I already have. But I'm not exactly well-versed in the program, so I'll play around with it and see what I can come up with and hopefully find a way to finally be able to develop something @_@
Is there any further info on the method to install on windows?
I have been trying to set up pygame_sdl2 purely for the purpose of converting a previously developed pygame to android.
I'm not developing in Ren'Py.
I basically get stuck at the same point user Glazed Donuts was, where the command for setup.py install fails for pygame_sdl2.
So I'm trying to figure out if I have the prereqs, and what other setup items I may be missing.
I have manually downloaded SDL2 libraries (in win binary form).
Also SDL mixer, ttf, gfx. so I now have the dlls for those.
Not exactly sure where they should go... I have many copies of SDL2.dll around, plus added it to the path, and created ENV variable
set PYSDL2_DLL_PATH=F:\rapt\_SDL2_DLLs
I have also used pip to install:
sdl2-lib
sdl2-cython
PySDL2
Haven't gotten "pysdl2-harness", or "pysdl2-cffi". no idea what those are, but showed up in pip search.
I'm still not sure I've got all the dependencies in place.
I have never used virtualenv before, so I may be messing up something there.
I run "activate.bat", and it adds a prompt so I *think* I'm "changing into a clone".
I can run python and "import sdl2" and that returns ok.
It also seems to import: sdl2.ext, sdl2.sdlmixer
But, when I try to install, I still get this:
File "setup.py", line 29, in <module>
parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
File "F:\rapt\pygame_sdl2-master\setuplib.py", line 83, in parse_cflags
output = subprocess.check_output(command, universal_newlines=True)
File "c:\python27\Lib\subprocess.py", line 537, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "c:\python27\Lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "c:\python27\Lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
PyTom wrote:At least at the moment, the easy method is to download Ren'Py, and grab the copy of pygame_sdl2 out of the Ren'Py distro.
Ok, I hope I'm interpreting right..
- From Renpy nightlies at http://nightly.renpy.org/current/
- download the latest version (and you don't mean the github renpy master?)
- assuming I need the *SDK.zip flavor of the nightlies
- from that download, I locate the folder pygame_sdl2
In my case, that is: renpy-nightly-2015-09-19-14c7a7d-sdk\lib\windows-i686\Lib\pygame_sdl2
And then... I manually install this into my python2.7 installation or virtualenv somehow?
I see also a pygame_sdl.pxd file under \module\include which I suspect I may need to do something with.
Still fumbling with this.. I cannot get it to even recognize pygame_sdl2 directory as a module.
I haven't gotten the "copy into site-packages" to work yet, so I was just trying to take baby steps, and directy do an import.
I'm trying to run python and just issue "import pygame_sdl2" with that pre-compiled folder.
The directory has a __init__.pyo file in there, so it seems like I should just be able to plop that folder in any current working directory, (e.g. "c:\spam\"),
then run python from that cwd and be able to import it.
But it says "No module named pygame_sdl2"
If I add an __init__.py file to the directory then it imports, and then I move on to import errors...
but my point is just that it I can't get it to treat it as a module.
Should I expect to be able to import it like this?