is it possible to run pygame or pyglet in a browser?

I have 3 game libraries installed on my PC: pyglet, pygame and Panda3D. I would like to create a 2D game and make it a web browser game so i can put it on facebook. I know that Panda3D has a...

how to play wav file in python?

I tried pygame for playing wav file like this: import pygame pygame.init() pygame.mixer.music.load("mysound.wav") pygame.mixer.music.play() pygame.event.wait() but It change the voice and I...

Pygame Screen tearing when moving line across screen

I am trying to move this image: Across my PyGame screen, from right to left and back again, However as the image moves, every second or so I have a flicker of screen tear make its way up the...

Python and Pyglet input

Total python beginner here. I'm trying to make a game with the Python library Pyglet. It's been working great until I got to the part where I need the input. I've followed the examples and docs...

Pyglet.image.ImageGrid() - indexing from top left

there. Using pyglet.image.ImageGrid(), is there any way to start off the grid from the top left, instead of the bottom left?

How to use pygame and pyglet at the same time

I'm using the pygame and pyglet libraries I want to create a window but it happens that the pygame window is created first and when you close it the pyglet window is created, I want them to be...

Flask python app crashes on heroku

I tried pushing my code directly to Heroku for hosting but I got so many errors. Now, what I did was host the code on Github, and then link the git repo with Heroku. Now, the Heroku app was...

Pyglet, exit after all sounds played

AVbin is installed. Both .wav and .mp3 files work. import pyglet music = pyglet.media.load('A.mp3') music.play() player = pyglet.media.Player() player.queue(...

Difficulties with AI-Gym Python graphics in Jupyter notebooks

I am trying to get AI-Gym demos to display in Jupyter notebooks. I get good results for the Atari demo Breakout-v0 and a difficult error message for the cart-pole demo CartPole-v0. Both work fine...

openAI Gym NameError in Google Colaboratory

I've just installed openAI gym on Google Colab, but when I try to run 'CartPole-v0' environment as explained here. Code: import gym env = gym.make('CartPole-v0') for i_episode in range(20): ...

ImportError: Library "GLU" not found

On CentOS 7.5 system, run python3 and execute the following code: import gym import time env = gym.make('CartPole-v0') observation = env.reset() count = 0 for t in range(100): action =...

dynamic body with segment shape do not move with a joint

In pymunk, I set the body mass and the space gravity, it should automatic fall down, but the body with segment shape do not move, here is my code in pyglet import pyglet import pymunk from...

Pyglet - Could not create UTF8 text property

I am trying to follow a guide about game developing using python and the 'acrade' package. I have installed arcade using: (I'm using linux) pip3 install arcade Then I have tried to compile the...

Load images from data stream and not from a file

I have a program (in Pyglet) in which I would like to keep the icons of them in the form of bytes, then convert them into temporary images and pass them to the program to be able to use them. This...

Do something while the button is pressed in Python pyglet

@win.event def on_key_press(key, modifiers): if key == pyglet.window.key.UP: print("UP") This function print UP just one time, but I want to print UP while I am holding the button UP.

Python 3.6.4 Arcade Module Window Errors? {pyglet.gl.lib.GLException: b'invalid enumerant'}

UPDATE: I checked the graphics cards installed on the computers. The one where it "works" has Nvidia Graphics and the other has Intel HD R graphics under display adapter in Device Manager. I'm...

AttributeError when running open_window command from the Python Arcade module

I just installed Python 3 and the arcade module on my MacBook and am trying to follow a simple Hello World tutorial:...

Python: How do I generate minecraft style terrain with pyglet?

I'm currently trying to make a Minecraft clone using pyglet and python for fun, and I found a nice tutorial which I used to create a player class with movement, and a 3D block that generates in...

how to change color of a shape in pymunk?

I am trying to create shapes using pymunk with pyglet. But I am facing a problem that I unable to change the color of a pymunk shape. They don't have any such attribute. I have tried draw_polygon...

Cannot run Glumpy example app using GLFW as backend

I've cloned glumpy from Github and am trying to run glumpy\examples\app-simple.py I can run the example fine if I install pyglet using pip install pyglet, (or, I think I can? The window causes...

ERROR: You must give at least one requirement to install -- when running: pip install --upgrade --no-binary hdbscan

I am trying to install hdbscan in my PC which runs Windows 10 and has installed Python 3.6. My first attempt failed: (base) C:\WINDOWS\system32>pip install hdbscan --user Collecting hdbscan ...

OpenAI "gym" Library throws a NoneType error on env.render()

This is my first time working with machine learning libraries, I used to make it all myself, and when I did it worked, but I guess that when everyone tells you not to do the job yourself and let...

Python Error - TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported

I think this is a not a programming specific bug, but is caused by some libraries. I am transferring my project to a new PC, which I have freshly setup with anaconda etc. using python 3.7.6....

How to get USB controller/gamepad to work with python

I have a USB controller that I'm trying to get inputs from, a Microsoft® SideWinder® Plug & Play Game Pad. I'm having difficulties trying to figure out how to receive its inputs correctly....

How do you draw simple shapes in Pyglet?

I'm trying to make a Towers of Hanoi program with Pyglet, but I'm having trouble drawing rectangles. Here is my code: import pyglet width, height = 500, 500 window = pyglet.window.Window(width,...

AttributeError: module 'tensorflow' has no attribute 'compat' when loading tf.compat.v1.train.SessionRunHook

I can see that this question has been asked before here tensorflow-has-no-attribute-compat but the answer given was to Microsoft Visual C++ 2015-2019 Redistributable (x64) It did not work for the...

Save image with background as transparent in pyglet

After some actions in my simple pyglet app I want to record the scene into a png image that includes transparency. I have set pyglet.gl.glClearColor(0,0,0,0) In an attempt to make the background...

ImportError: Can't find framework /System/Library/Frameworks/OpenGL.framework

I am trying to run this simple gym example on the new macOs Big Sur. import gym env = gym.make('CartPole-v0') env.reset() for _ in range(1000): env.render() ...

Running code returns with "color must int or tuple"

I was running a tower defence game in the arcade module but after I press start, the game freezes up and returns with Traceback (most recent call last): File...

Conda - how to update only cudatoolkit in an existing environment?

This is a specific instance of a general problem that I run into when updating packages using conda. I have an environment that is working great on machine A. I want to transfer it to machine...