Загрузка...

Pygame not working

Thread in Python created by Qtejce Feb 15, 2020. 304 views

  1. Qtejce
    Qtejce Topic starter Feb 15, 2020 1 May 1, 2017
    До этого пользовался линуксом, сейчас купил мак и когда попытался запустить на нём программу она выдала вот такой серый экран. В гугле ничего не нашёл. Может кто шарит в пайгейме и знает как это решить. Может это какие-то ограничения мака[IMG]
     
  2. oriole
    oriole Feb 15, 2020 был(а) давно
    ну и где ошибка ?
     
  3. Qtejce
    Qtejce Topic starter Feb 15, 2020 1 May 1, 2017
    oriole, ошибки нет, просто вместо картинки серый экран в этом то и проблема, что не понятно в чём проблема
     
  4. sesu
    sesu Feb 15, 2020 Ты не умеешь писать код 114 Nov 17, 2019
    Ну погугли что то вроде 'gray screen pygame macos'
     
  5. Kyber_Zero
    Kyber_Zero Feb 22, 2020 Dead Inside 5 Jan 21, 2018
    Qtejce, Код покажи нам)
     
  6. vurtune
    vurtune Feb 22, 2020 Banned 9 Jan 9, 2017
    Initially, go to the GitHub page of Pygame and see which stable version is the latest. As of this writing, the latest stable version of PyGame is 1.9.6 and 2.0.0 is prerelease. If you want the latest (unstable/prelease just use master when cloning below), if however you want the latest stable, change branch accordingly.

    Here are the steps:


    Install some dependencies brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf. This requires homebrew.
    Go to site-packages:

    For virtual environment go to cd ~/.virtualenvs/myvirtualenv/lib/python3.X/site-packages where ~/.virtualenvs/myvirtualenv is the path to your virtual environment and python3.X is the version of your Python.
    For system-wide installation go to /usr/local/lib/python3.X/site-packages where python3.X is the version of your Python.

    Delete any previous pygame, pip uninstall pygame (if a pygame directory exists in site-packages then remove it: rm -rf pygame*)
    Clone pygame from GitHub:

    git clone https://github.com/pygame/pygame.git for the latest (possibly not stable version).
    git clone -b v1.9.6 https://github.com/pygame/pygame.git for the latest (stable, based on what you checked above, v1.9.6 as of this writing)

    Go into the pygame directory: cd pygame.
    Run python setup.py --config --auto --sdl2. If you get problems with this command, some users below mentioned that single hyphens worked for them, therefore try: python setup.py -config -auto -sdl2
    Run python setup.py install (it will take a while).

    Now PyGame should work as expected on macOS.
     
  7. Qtejce
    Qtejce Topic starter Feb 23, 2020 1 May 1, 2017
    vurtune, всё сделал - не помогло. Наверное буду линукс на флешку ставить
     
  8. Kyber_Zero
    Kyber_Zero Feb 23, 2020 Dead Inside 5 Jan 21, 2018
    Qtejce, Чел, у тебя какой питон стоит?
     
  9. Qtejce
    Qtejce Topic starter Feb 23, 2020 1 May 1, 2017
    Kyber_Zero, python 3.8. эта же прога запускается на убунте (значит дело не в моем коде)
    The post was merged to previous Feb 23, 2020
    Проблема решена! brew unlink python
    sudo pip3 install pygame==2.0.0.dev4
     
Loading...
Top