This week there was a feature in the repl.it newsletter on replit-play. It was able to run the cat example in the author's example repl, but when I tried to run the same code in my own repl, Some packages would install and compile, but other packages would install but not run. Here are the results:
Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
Hello from the pygame community. https://www.pygame.org/contribute.html
Loading chipmunk for Linux (64bit) [/home/runner/.local/lib/python3.6/site-packages/pymunk/libchipmunk.so]
Traceback (most recent call last):
File "main.py", line 1, in <module>
File "/home/runner/.local/lib/python3.6/site-packages/play/init.py", line 3, in <module>
from .play import *
File "/home/runner/.local/lib/python3.6/site-packages/play/play.py", line 88, in <module>
_pygame_display = pygame.display.set_mode((screen.width, screen.height), pygame.DOUBLEBUF)
pygame.error: No available video device
I was running this from Chrome browser, but same results in Firefox and Edge browsers...
Some thing about my repl.it configuration--such as the author was running Python 3.6.7, my repls run 3.6.1--is different enoughto cause problems.
I am assuming anyone who looks at this post can find the repl.it newsletter and run the same example, so I'm not posting code here.
Be sure that when you're trying to run a Pygame game, choose
Pygame as the language, because it will load the additional modules needed for Pygame in addition to v3.6.7 of Python. I'm thinking that the generic
Python (Python3) doesn't load the necessary video/audio modules.
Here's an example with your code:
If this solved your problem, please upvote and accept my answer as the correct answer to close this question. I'll continue to answer any questions you may have.
@heyitsmarcus That worked. From the original documentation on replit-play, I wouldn't have known that pygame is a dependency, and I would have expected the package loading scripts and whatever else runs to correctly load and configure the video drivers.
In any case, this solved the problem, so now I know how to tell myself and my students what to do to use replit-play in assignments.