Загрузка...

Не работает Pygame

Тема в разделе Python создана пользователем Qtejce 15 фев 2020. 303 просмотра

  1. Qtejce
    Qtejce Автор темы 15 фев 2020 1 1 май 2017
    До этого пользовался линуксом, сейчас купил мак и когда попытался запустить на нём программу она выдала вот такой серый экран. В гугле ничего не нашёл. Может кто шарит в пайгейме и знает как это решить. Может это какие-то ограничения мака[IMG]
     
  2. oriole
    oriole 15 фев 2020 был(а) давно
    ну и где ошибка ?
     
  3. Qtejce
    Qtejce Автор темы 15 фев 2020 1 1 май 2017
    oriole, ошибки нет, просто вместо картинки серый экран в этом то и проблема, что не понятно в чём проблема
     
  4. sesu
    sesu 15 фев 2020 Ты не умеешь писать код 114 17 ноя 2019
    Ну погугли что то вроде 'gray screen pygame macos'
     
  5. Kyber_Zero
    Kyber_Zero 22 фев 2020 Dead Inside 5 21 янв 2018
    Qtejce, Код покажи нам)
     
  6. vurtune
    vurtune 22 фев 2020 Заблокирован(а) 9 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 Автор темы 23 фев 2020 1 1 май 2017
    vurtune, всё сделал - не помогло. Наверное буду линукс на флешку ставить
     
  8. Kyber_Zero
    Kyber_Zero 23 фев 2020 Dead Inside 5 21 янв 2018
    Qtejce, Чел, у тебя какой питон стоит?
     
  9. Qtejce
    Qtejce Автор темы 23 фев 2020 1 1 май 2017
    Kyber_Zero, python 3.8. эта же прога запускается на убунте (значит дело не в моем коде)
    --- Сообщение объединено с предыдущим 23 фев 2020
    Проблема решена! brew unlink python
    sudo pip3 install pygame==2.0.0.dev4
     
Загрузка...
Top