0

I'm trying to get PyGame running in a docker (so I can eventually work with PyGame and TensorFlow in windows). But when I try run:

pip install pygame

I get back

root@03da78748024:~# pip install pygame
Collecting pygame
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement pygame (from versions: )
No matching distribution found for pygame

Pip install does work with other packages, e.g. pybrain. Also is successfully installed on my windows machine. But I want to install it within docker so I can use it with TensorFlow.

Does anyone have any experience of getting pygame running in docker? Is it even possible?

Thanks in advance.

Daniel Slater
  • 4,123
  • 4
  • 28
  • 39
  • I know it's really old thread but I'm trying to create a pygame-windows docker... the source code would be very helpful, can you share? – pgp1 Jul 26 '20 at 21:17

1 Answers1

1

You can try installing the security extras:

https://stackoverflow.com/a/29202163/1703772

Some questions:

The fact that it reports no versions of pygame accessible is a red flag. You could try installing using a windows installer: https://bitbucket.org/pygame/pygame/downloads (from https://scicomp.stackexchange.com/questions/2987/what-is-the-simplest-way-to-do-a-user-local-install-of-a-python-package)

UPDATE:

From my non-exhaustive searching, Windows + Docker + pip to install pygame will not work at this time. Installing using a windows installer seems to be the accepted solution by many.

Here are some solutions you can try:

The current pygame on pypi is 1.7.1 and supports up to Windows 2000/NT: https://pypi.python.org/pypi/Pygame/1.7.1? - perhaps your windows version is too new.

I hope this has answered your question.

Community
  • 1
  • 1
NuclearPeon
  • 5,743
  • 4
  • 44
  • 52
  • Thanks, for getting back to me, I've edited my question to make some of it clearer. pip install of other stuff does work. Don't think I can do an install of the windows binaries into Docker? – Daniel Slater Dec 28 '15 at 18:52
  • @DanielSlater It seems possible, but difficult according to this google group for docker users using linux: https://groups.google.com/forum/#!topic/docker-user/twc786X3ChM Another forum states that they used the `.msi` version to get it working: https://www.reddit.com/r/pygame/comments/3j1ks2/installing_pygame_via_pip_on_windows/ . I've searched around in the past 15 minutes on google and it seems that windows + docker + pygame does not work with `pip`. – NuclearPeon Dec 28 '15 at 19:09
  • @DanielSlater I have installed python 2.7.9 and Docker Toolbox 1.9.1f and trying to install pygame results in this message: `Could not find any downloads that satisfy the requirement pygame`. Pip packages that depend on pygame fail to install with the same message. – NuclearPeon Dec 28 '15 at 22:46
  • thank you so much for taking the time to do this. This is exactly where I got to when trying to do this. – Daniel Slater Dec 29 '15 at 14:10