Ubuntu 18.04 Além da pip install solução óbvia no 18.04, a outra alternativa é baixar manualmente o arquivo python3-pygame . deb para o 19.04 e instalá-lo sudo apt ./python3-pygame_1. 9.4.
Depois de instalar o Python, instale o PyGame por meio da linha de comando (ou do terminal no VS Code) digitando python -m pip install -U pygame --user . Se tudo estiver certo, o jogo abrirá uma janela. Feche a janela quando terminar de jogar.
Primeiro, é preciso importar o módulo Pygame com o comando import pygame. Depois, é preciso importar os locals do pygame que contém eventos de controle, mouse e teclados com o comando from pygame. import locals *.
Para o PyCharm 2017, faça o seguinte:
To install PyGame for Python 3.x on Ubuntu 19.04 and later open the terminal and type: To install python3-pygame in Ubuntu 18.10 open the terminal and type: Add this line to sources.list. Update the list of available software and install python3-pygame.
If it works in the console when you type 'python yourscript.py' but not in vs code, you should press ctrl+shift+p and use clic on Python select interpreter to switch to the right env. if it sstill doesn't work then install the package by running 'python -m pip install pygame' Thanks for contributing an answer to Stack Overflow!
Whenever I start python and type import pygame it tells me that there is no module named pygame. How can I install pygame? The reason you are not able to import pygame into your python interpreter is because you are installing it for python2 and starting the python3 interpreter (Ubuntu 13.10 uses python3 by default).
If you are using the Thonny IDE go under: Search for Pygame in the search bar then double click the pthird-party plugin. Thanks for contributing an answer to Ask Ubuntu!
Como ficar elegante sem usar sapato de salto alto?
Como ficar de cabeça pra baixo CrossFit?
Como medir a pressão arterial invasiva?
Como pegar o passarinho na mão?
Quem teve contato com pessoa com tuberculose?
Quando o Google Play Music vai acabar?
Como pegar um pack inteiro no criativo?
Porque o beijo acaba no casamento?
Como pedir desculpas para uma pessoa importante?
Como recuperar Windows pelo prompt de comando?
Como pegar avião no GTA código?
Como recuperar minha conta Konami ID?
Como baixar diretório do GitHub?
Como pegar o valor de um atributo javascript?
Como recuperar arquivos armazenados na nuvem?