renpy / pygame_sdl2

Reimplementation of portions of the pygame API using SDL2.
GNU Lesser General Public License v2.1
326 stars 64 forks source link

Windows Install of pygame_sdl2 #100

Closed Remusforte closed 6 years ago

Remusforte commented 6 years ago

I am trying to follow the (rather sparse) instructions for installing pygame_sdl2 in Windows. When I attempt to run the setup file, I get this response: C:\pygame_sdl2-master>python setup.py install Traceback (most recent call last): File "setup.py", line 60, in <module> parse_cflags([ "sh", "-c", "sdl2-config --cflags" ]) File "C:\pygame_sdl2-master\setuplib.py", line 93, in parse_cflags output = subprocess.check_output(command, universal_newlines=True) File "C:\Python27\lib\subprocess.py", line 212, in check_output process = Popen(stdout=PIPE, *popenargs, **kwargs) File "C:\Python27\lib\subprocess.py", line 390, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 640, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified

Any thoughts what might be going wrong here?

MyreMylar commented 6 years ago

My first thought is to make sure you have downloaded the windows dependencies and dragged the folder into your pygame_sdl2 directory.

On Sun, 29 Apr 2018, 21:11 Remusforte, notifications@github.com wrote:

I am trying to follow the (rather sparse) instructions for installing pygame_sdl2 in Windows. When I attempt to run the setup file, I get this response: C:\pygame_sdl2-master>python setup.py install Traceback (most recent call last): File "setup.py", line 60, in parse_cflags([ "sh", "-c", "sdl2-config --cflags" ]) File "C:\pygame_sdl2-master\setuplib.py", line 93, in parse_cflags output = subprocess.check_output(command, universal_newlines=True) File "C:\Python27\lib\subprocess.py", line 212, in check_output process = Popen(stdout=PIPE, *popenargs, **kwargs) File "C:\Python27\lib\subprocess.py", line 390, in init errread, errwrite) File "C:\Python27\lib\subprocess.py", line 640, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified

Any thoughts what might be going wrong here?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/renpy/pygame_sdl2/issues/100, or mute the thread https://github.com/notifications/unsubscribe-auth/AMwzGixQNZzwZtNGrcq69jCqnubVf_lWks5tth6MgaJpZM4Tr8B1 .

Remusforte commented 6 years ago

I did download the ZIP file: pygame_sdl2_windeps-master and unZip'd it. But I must say I am not clear exactly where _"your pygamesdl2 directory" is precisely?

I separately downloaded the ZIP file: pygame_sld2-master and unZip'd it as well. So I suppose the first question is: Precisely where should that folder be placed in the system? Along side C:\Python27? Inside C:\Python27? Somewhere deeper inside (like in site-packages)?

Once that folder (which is actually named "pygame_sdl2-master") is created, does the "windeps" folder go inside it? Or is there some other "pygame_sdl2" folder that is supposed to have been created somewhere that I have yet to locate?

The error messages above were generated when I took my best guess from the various posts and did the following:

  1. Downloaded pygame_sdl2-master.zip and unZip'd to C:\, generating the folder: C:\pygame_sdl2-master
  2. Downloaded pygame_sdl2_windeps-master.zip and unZip'd to be inside the above, generating the folder C:\pygame_sdl2-master\pygame_sdl2_windeps-master
  3. Used command prompt to navigate to the directory C:\pygame_sdl2-master
  4. Entered the command: "python setup.py install"
  5. The result is the series of error messages listed in the first post

So any clarity on the exact location for placing these two folders (and any others I might be missing) would be helpful. Thanks!

MyreMylar commented 6 years ago

Sounds like you have the right locations, but it looks like you have the git branch names on the end of your paths. IIRC (not in front of a PC right now) you will want to remove the '-master' from your directory names and try again.

If that doesn't work you might also want to make sure you have Cython installed (pip install Cython) and that your python install is on you windows PATH environment variable. And perhaps try running setup.py from a CMD prompt with administrator rights.

On Mon, 30 Apr 2018, 11:44 Remusforte, notifications@github.com wrote:

I did download the ZIP file: pygame_sdl2_windeps-master and unZip'd it. But I must say I am not clear exactly where "your pygame_sdl2 directory" is precisely?

I separately downloaded the ZIP file: pygame_sld2-master and unZip'd it as well. So I suppose the first question is: Precisely where should that folder be placed in the system? Along side C:\Python27? Inside C:\Python27? Somewhere deeper inside (like in site-packages)?

Once that folder (which is actually named "pygame_sdl2-master") is created, does the "windeps" folder go inside it? Or is there some other "pygame_sdl2" folder that is supposed to have been created somewhere that I have yet to locate?

The error messages above were generated when I took my best guess from the various posts and did the following:

  1. Downloaded pygame_sdl2-master.zip and unZip'd to C:, generating the folder: C:\pygame_sdl2-master
  2. Downloaded pygame_sdl2_windeps-master.zip and unZip'd to be inside the above, generating the folder C:\pygame_sdl2-master\pygame_sdl2_windeps-master
  3. Used command prompt to navigate to the directory C:\pygame_sdl2-master
  4. Entered the command: "python setup.py install"
  5. The result is the series of error messages listed in the first post

So any clarity on the exact location for placing these two folders (and any others I might be missing) would be helpful. Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/renpy/pygame_sdl2/issues/100#issuecomment-385364380, or mute the thread https://github.com/notifications/unsubscribe-auth/AMwzGoGnfRshHuYa4_NBXbtS42sAiEOGks5ttusSgaJpZM4Tr8B1 .

Remusforte commented 6 years ago

Good idea to try a Admin CMD prompt. And after doing so, I double-checked that cython is indeed installed (see first pic). All good there:

image

Also (very) good idea to remove the "-master" suffixes! I have done so, and here is the resulting folder/file structure I am installing with: image

Then I ran: "python setup.py install" from within the C:\pygame_sdl2 directory, using that Admin enabled CMD prompt. And I think it worked! :)

The installer went through and listed all of the various pygame_sdl2 commands as "out of date", then ran the install program, churned through a bunch of stuff, and ended with a happy statement that indicates all is well:

`C:\pygame_sdl2>python setup.py install

pygame_sdl2.error is out of date. pygame_sdl2.color is out of date. pygame_sdl2.controller is out of date. pygame_sdl2.rect is out of date. pygame_sdl2.rwobject is out of date. pygame_sdl2.surface is out of date. pygame_sdl2.display is out of date. pygame_sdl2.event is out of date. pygame_sdl2.locals is out of date. pygame_sdl2.key is out of date. pygame_sdl2.mouse is out of date. pygame_sdl2.joystick is out of date. pygame_sdl2.power is out of date. pygame_sdl2.pygame_time is out of date. pygame_sdl2.image is out of date. pygame_sdl2.transform is out of date. pygame_sdl2.gfxdraw is out of date. pygame_sdl2.draw is out of date. pygame_sdl2.font is out of date. pygame_sdl2.mixer is out of date. pygame_sdl2.mixer_music is out of date. warning: src\pygame_sdl2\mixer_music.pyx:58:0: Overriding cdef method with def method. pygame_sdl2.scrap is out of date. pygame_sdl2.render is out of date. running install running bdist_egg running egg_info

...(bunch of stuff)...

Installed c:\python27\lib\site-packages\pygame_sdl2-2.1.0-py2.7-win32.egg Processing dependencies for pygame-sdl2==2.1.0 Finished processing dependencies for pygame-sdl2==2.1.0 `

That looks promising! And when I load Python27 IDLE, I can now successfully import pygame_sdl2, which is a huge step forward. Next I will attempt to run a test program to check functionality. But at this stage, it appears the package has installed!

I will leave this thread open until I complete that test and ensure actual functionality from the install. And hopefully my pics with specific folder names/locations will help others who stumble on this in the future!

Thanks for the help!

Remusforte commented 6 years ago

I will close this issue now. The testing modules work sporadically, but if/when I have specific need, I will open a more pointed Issue at that time.

manas5110 commented 6 years ago

Does python_sdl2 work only with Python 2.7? I'm facing a similar issue. PFB error. Can you please check what might be wrong here..

C:\Users\abha\Downloads\Manas\python_sdl2>python setup.py install pygame_sdl2.error is out of date. Traceback (most recent call last): File "setup.py", line 110, in cython("pygame_sdl2.error", libs=sdl_libs) File "C:\Users\abha\Downloads\Manas\python_sdl2\setuplib.py", line 245, in cyt hon c_fn]) File "C:\Users\abha\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 323, in check_call retcode = call(*popenargs, *kwargs) File "C:\Users\abha\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 304, in call with Popen(popenargs, **kwargs) as p: File "C:\Users\abha\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 756, in init restore_signals, start_new_session) File "C:\Users\abha\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1155, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified

I-K0haku-I commented 4 years ago

@manas5110 No, I installed it with python37 too.

For anyone wondering, you shouldn't use a virtual environment, that will mess up the setup.py install. You can use your compiled wheels to install pygame_sdl2 into your virtiual environment later.