Python Forum
pip install pygame choking on SDL dependency
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip install pygame choking on SDL dependency
#7
I tried installing python 3 and am happy to report that, contrary to what you might read elsewhere, this installation does not change the python command to use python 3. This also allowed me to install pygame easily in a virtualenv with a simple pip install pygame but did not solve my problem because apparently livewires is not compatible with python 3.

So I broke down and installed homebrew and installed a long list of stuff per this link. My approach was to try and make sure I got the major libraries installed then try the pip install again. This may not be a complete list of brew commands but it appears to have resolved any errors:
Output:
# install home-brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew tap caskroom/cask brew install caskroom/cask/brew-cask brew cask install xquartz brew linkapps python brew install sdl sdl_image sdl_ttf portmidi libogg libvorbis brew install sdl_mixer --with-libvorbis brew tap homebrew/headonly brew install smpeg brew install mercurial
I then ran pip install pygame and it appears to have run to completion. I was able to run python -m pygame.tests and it skips a few but otherwise reports OK:
Output:
Ran 715 tests in 19.033s OK
My short program now runs without any errors at all and the stdout reports pygame:
Output:
pygame 1.9.4 Hello from the pygame community. https://www.pygame.org/contribute.html
However, it just shows a window without the background image. I’ve checked, double-checked, triple-checked that the image exists, is valid, and the path is correct. I’ve tried an absolute path. It just won’t show the jpeg.

My game script is so far very short. Just this:
from livewires import games

games.init(screen_width = 640, screen_height = 480, fps = 50)

wall_image = games.load_image("/Users/yamo/trash/python/ch11/wall.jpg", transparent = False)
games.screen.background = wall_image

games.screen.mainloop()
If anyone can help me get this working, I’d be most grateful.
Reply


Messages In This Thread
RE: pip install pygame choking on SDL dependency - by sneakyimp - Jan-22-2019, 06:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't get pygame to install djwilson0495 13 10,452 Dec-07-2020, 01:30 PM
Last Post: djwilson0495
  Trying to install pygame Mac OS x high sierra giladal 2 2,799 Oct-18-2020, 09:27 PM
Last Post: nilamo
  Error to install pygame skp 1 3,560 Apr-14-2020, 05:17 PM
Last Post: joe_momma
  PIP cannot install Pygame Amaly84 6 10,073 Sep-04-2019, 07:59 PM
Last Post: Amaly84
  pip can't install pygame SheeppOSU 1 9,499 Dec-08-2018, 08:20 PM
Last Post: snippsat
  How to install Pygame chappie 2 3,470 Dec-06-2017, 10:47 PM
Last Post: chappie
  How to begin coding for game making [Install pygame on mac] mattkrebs 2 5,009 Apr-02-2017, 10:57 AM
Last Post: machrider
  [split] permission error on pygame install pyteach 7 8,306 Jan-23-2017, 11:00 PM
Last Post: pyteach

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020