Pygame already installed; however, python terminal says No module named 'pygame' (Ubuntu 20.04.1)
There isn't a release build of pygame 1.9.6 for Python 3.8.2. Install a development version:
python3 -m pip install pygame==2.0.0.dev10
Pygame error Video system not initialized on ubuntu server with only terminal
Thank for your answer jsbueno. I was able to found a solution a few weeks ago but forget to answer the question.
I wasn't able to run any pygame script with any other library than X11. But I found that one can run the script with no graphics library. Just setting the SDL_VIDEOLIBRARY enviroment variable to "dummy".
This is posible on bash but I prefer to do it on python:
os.environ["SDL_VIDEODRIVER"] = "dummy"
With this I was able to run the pygame script, detect joystick events, etc.
Related Topics
How to Validate a Url with a Regular Expression in Python
Arranging Text Files Side by Side Using Python
Linux: Pipe into Python (Ncurses) Script, Stdin and Termios
Parallel Processing from a Command Queue on Linux (Bash, Python, Ruby... Whatever)
Caesar Cipher Function in Python
Running Selenium Webdriver with a Proxy in Python
Detecting Consecutive Integers in a List
How Do Chained Assignments Work
How to Convert the Background Color of Image to Match the Color of Pygame Window
Too Many Values to Unpack', Iterating Over a Dict. Key=>String, Value=>List
How to Use Python2.7 Pip Instead of Default Pip
Pickled File Won't Load on MAC/Linux
Financial Charts/Graphs in Ruby or Python
Pandas Add Column to Groupby Dataframe
Quick and Easy File Dialog in Python