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
#11
If your test run fine then pygame works. You are just having an issue with livewire's API, not pygame.

Quote:The window appears, but no background image.
In pygame to display anything, you have to 1) blit it and 2) make sure the screen is updated. Since i have no idea where this is in their code, i cannot say exactly how they do that.

in my opinion, you should probably just learn pygame instead. Livewire is just a wrapper to pygame. If you end up getting into it, you would have to relearn pygame's API anyways to do more complex tasks. Also Pygame's API is very well known, documented, and discussed in all places. Ive seen kids 8 years old and up use pygame effectively. Livewire is not the same. There are tons of pygame wrappers. For some reason people think they need to make their own wrapper and publish them for beginners to use to make it easier on them. However it makes it harder because you find hardly anyone who uses it and poorly documented (as you have found out).

Based on their website it appears there is even a cost
livewires.org.uk/helping/ Wrote:The cost for 2018 is £252, which is 90% of the YP fee.
Pygame is free. The docs are free. The tutorials and help learning it is free. The software is free. In fact you could even close source your game. Pygame is LGPL specifically so you can use it in close-sourced projects. (source from the horses mouth)
Recommended Tutorials:
Reply
#12
(Jan-22-2019, 06:48 PM)metulburr Wrote: If your test run fine then pygame works. You are just having an issue with livewire's API, not pygame.
I don't think that is true. I've run the exact same code (including the livewires source from the book, which is free -- and customized) on my Ubuntu desktop and it runs properly. I see the window and the background image.

There's something wrong with pygame on Mac, which runs Mojave, pygame 1.9.4, and python 2.7.15. There is evidently some kind of issue with pygame on Mojave for some folks.

(Jan-22-2019, 06:48 PM)metulburr Wrote: in my opinion, you should probably just learn pygame instead. Livewire is just a wrapper to pygame. If you end up getting into it, you would have to relearn pygame's API anyways to do more complex tasks...Pygame is free. The docs are free. The help is free. The software is free. Pygame is LGPL specifically so you can use it in close-sourced projects
I agree that learning pygame directly is probably the way to go, but also believe there is some kind of problem with my installation.
Reply
#13
(Jan-22-2019, 06:54 PM)sneakyimp Wrote: I don't think that is true. I've run the exact same code (including the livewires source from the book, which is free -- and customized) on my Ubuntu desktop and it runs properly. I see the window and the background image.
In that case yes you are right.

If you have majave you can try some thigng based on here:
https://github.com/pygame/pygame/issues/555

1) miniconda appears to work on majave pygame/python if you just want to get it running

2) one person states that python3.7.0 with pygame 1.9.4 does not encounter this problem
Recommended Tutorials:
Reply
#14
(Jan-22-2019, 07:11 PM)metulburr Wrote: If you have majave you can try some thigng based on here:
https://github.com/pygame/pygame/issues/555
Oh dang that github thread looks totally chaotic. I'm starting to think that graphics and/or game programming in Python doesn't sound like a very productive study path for python if I'd like to improve my skills. I'm guessing my time might be better spent looking into data science or AI applications.

(Jan-22-2019, 07:11 PM)metulburr Wrote: 1) miniconda appears to work on majave pygame/python if you just want to get it running

2) one person states that python3.7.0 with pygame 1.9.4 does not encounter this problem
1) Having tried pip, python 2 and 3, homebrew, pygame (and over half a dozen subsidiary libraries), etc. I'm not sure investing time in miniconda is worth it just to get this outdated livewires/pygame thing working. I'm having my doubts about pygame now.
2) As I posted earlier in this thread, I tried python3 and it installed pygame just fine, but the version of livewires i have doesn't work with python 3.

I'm thinking I might just walk away from this book and its outdated livewires and finicky pygame and just head down a different learning path. Sad
Reply
#15
(Jan-22-2019, 08:44 PM)sneakyimp Wrote: I'm thinking I might just walk away from this book and its outdated livewires and finicky pygame and just head down a different learning path.
Unfortunately mac and pygame always has problems. You are not the first.
Recommended Tutorials:
Reply
#16
Quote: I'm having my doubts about pygame now.
Please don't compare livewires to pygame. Pygame has it own faults.

Pygame example.
import pygame

class Scene:
    def __init__(self, title, width, height):
        # basic pygame setup
        pygame.display.set_caption(title)
        self.rect = pygame.Rect(0, 0, width, height)
        self.surface = pygame.display.set_mode(self.rect.size)
        self.clock = pygame.time.Clock()

        # your code
        image_name = "/Users/yamo/trash/python/ch11/wall.jpg"
        # convert the image to match pygame format
        self.wall_image = pygame.image.load(image_name).convert()

    def mainloop(self):
        self.running = True

        while self.running:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    self.running = False

            # draw code here
            # background
            self.surface.blit(self.wall_image, (0,0))

            pygame.display.flip()
            # don't max out cpu. limit framerate.
            self.clock.tick(30)

if __name__ == '__main__':
    pygame.init()
    scene = Scene('Example', 640, 480)
    scene.mainloop()
    pygame.quit()
99 percent of computer problems exists between chair and keyboard.
Reply
#17
(Jan-22-2019, 09:47 PM)Windspar Wrote: Please don't compare livewires to pygame. Pygame has it own faults.

Thank you so much for that generous bit of code. Just like my code, it works on my Ubuntu machine just fine but does not work on my laptop running OSX Mojave, python 2.7.15, and pygame 1.9.4. Just like my code, this opens a window but the background image doesn't show up. Some things I'd like to reiterate:

1) Clearly I am not the only person having trouble with with PyGame and Mojave.

2) The livewires code works just fine on my Ubuntu machine. As does your code. The flaw must therefore lie in the implementation of pygame.

3) As I've mentioned here a couple of times now, the customized livewires code that came with my book is incompatible with python 3. Upgrading to python 3 on my Mac might remedy some pygame problems, but that would render the last 2 chapters in my book moot.

4) My enthusiasm to embrace pygame is hampered by the thought that it doesn't work on the latest version OSX unless you also upgrade to python 3 or bundle python 3 with your installer. OSX distributes python 2.7.

Is there big demand for games written in python or for pygame skills? The word "pygame" doesn't even appear on los angeles craigslist.
Reply
#18
(Jan-22-2019, 11:37 PM)sneakyimp Wrote: Is there big demand for games written in python or for pygame skills? The word "pygame" doesn't even appear on los angeles craigslist.
This logic doesnt make any sense. First of all why would you search software on Craigslist? Secondly, if you replace pygame with the most known programming language your first result is rental apartments that include A/C++ (air conditioning). This has no merit in whether to weigh software's value.

(Jan-22-2019, 11:37 PM)sneakyimp Wrote: 4) My enthusiasm to embrace pygame is hampered by the thought that it doesn't work on the latest version OSX unless you also upgrade to python 3 or bundle python 3 with your installer. OSX distributes python 2.7.
I know its frustrating. A lot of people have problems. You might continue to have them if you are not willing to try things such as using python3.x. Problems with pygame is not the only reason i will never buy an Apple product Hand .

(Jan-22-2019, 11:37 PM)sneakyimp Wrote: Upgrading to python 3 on my Mac might remedy some pygame problems, but that would render the last 2 chapters in my book moot.
That is not completely true. There are minor differences in the majority of tutorials that are 2.x/3.x. Most tutorials can be ported to python3.x quite easily as long as you know the differences. You can search out the differences even on our website. Pygame does work for both python2.x and python3.x. I cant say the same about livewires.

most of which is not going to be applicable to a basic tutorial.

As a side note. Python2.x is planning on being retired at the end of this year. Some linux distros (arch and gentoo) started using python3.x back in 2013 as the default python. Python2.x was suppose to end completely in 2015, but was extended to 2020 only for security/bugfixes. After 2020 it is likely that there will not even be security updates or bugfixes for python2.x forcing everyone to abandon it due to security alone. Even on our website; we will remove the toplink versions as python2.x will be archived. For example, if you were to post this issue a year from now....the proper answer would be to update to python3.x and to stop using a python2.x tutorial. I dont know if this is the problem or not.....but if i was a developer on pygame i would not worry about pygame working with python2.x on the latest mac release because of its soon to be death. I would be more focused on updating it to the latest python minor release and making sure it works for the majority.
Recommended Tutorials:
Reply
#19
(Jan-23-2019, 12:20 AM)metulburr Wrote: This logic doesnt make any sense. First of all why would you search software on Craigslist? Secondly, if you replace pygame with the most known programming language your first result is rental apartments that include A/C++ (air conditioning). This has no merit in whether to weigh software's value.
Yes of course there are some unrelated posts, but my point is that there is not a single result on los angeles craigslist for pygame. Not one.. Compare that to a search for PHP, Javascript, or react. It's not definitive or anything, just might be tricky to find pygame work if searching on craigslist -- at least in Los Angeles.

(Jan-23-2019, 12:20 AM)metulburr Wrote: Problems with pygame is not the only reason i will never buy an Apple product...
The laptop is my wife's old one, refurbed with an SSD drive. I would not buy a macbook either. I did not mean to suggest pygame must work on OSX and I have no special affinity for OSX. On the contrary. I've only recently started working with it to broaden my skillset. I was just thinking that the prospect of chasing down a solution to display issues sounds like thankless and frustrating work. I'd much rather be coding.

As for my book, all its code examples assume livewires is in use. Perhaps online pygame tutorials would be better. Let's just say that it's challenge enough to slog thru the book. It's more of a slog if I must learn not just the code in the book (which won't work) but also learn to translate that code into unadulterated pygame. I think I'd be better off dumping the book. I personally don't give a hoot about livewires and have no affinity for python 2.

Quote:Python 2.x Syntax: 'bbb' for byte in strings...
Dang So many differences! I really appreciate that list.

I certainly agree that livewires and python 2 don't look especially interesting/productive as avenues of study. I think I'd be wise to focus on learning skills specific to the job market rather than chasing the "fun" Rolleyes work of developing games. I'm especially interested in the supposedly lucrative fields of AI, Machine learning, security, and data science. I've finished 10 of 12 chapters in this book and haven't seen any DB interaction, network requests, or website hosting information. Sort of wondering where energy is best invested.
Reply
#20
Maybe this link will help.
Mac pip install
99 percent of computer problems exists between chair and keyboard.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't get pygame to install djwilson0495 13 9,984 Dec-07-2020, 01:30 PM
Last Post: djwilson0495
  Trying to install pygame Mac OS x high sierra giladal 2 2,716 Oct-18-2020, 09:27 PM
Last Post: nilamo
  Error to install pygame skp 1 3,457 Apr-14-2020, 05:17 PM
Last Post: joe_momma
  PIP cannot install Pygame Amaly84 6 9,657 Sep-04-2019, 07:59 PM
Last Post: Amaly84
  pip can't install pygame SheeppOSU 1 9,430 Dec-08-2018, 08:20 PM
Last Post: snippsat
  How to install Pygame chappie 2 3,389 Dec-06-2017, 10:47 PM
Last Post: chappie
  How to begin coding for game making [Install pygame on mac] mattkrebs 2 4,909 Apr-02-2017, 10:57 AM
Last Post: machrider
  [split] permission error on pygame install pyteach 7 8,129 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