在docker中运行pygame

我试图让PyGame在Docker中运行(所以我最终可以在Windows中使用PyGame和TensorFlow)。 但是当我尝试运行时:

pip install pygame 

我回来了

 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安装可以与其他软件包,例如pybrain。 也是成功安装在我的Windows机器上。 但是我想在Docker中安装它,所以我可以使用它与TensorFlow。

有没有人有任何获得在docker运行pygame的经验? 这甚至有可能吗?

提前致谢。

您可以尝试安装安全附加function:

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

一些问题:

事实上,它报告没有可访问pygame的版本是一个红旗。 你可以尝试安装使用Windows安装程序: https : //bitbucket.org/pygame/pygame/downloads (从https://scicomp.stackexchange.com/questions/2987/what-is-the-simplest-way-to- do-a-user-local-install-of-python-package )

更新:

从我的非详尽的search, Windows +的Docker + pip安装pygame 将不会在这个时候工作。 使用Windows安装程序安装似乎是许多人接受的解决scheme。

以下是您可以尝试的一些解决scheme:

  • 通过pip wheel安装在本地(64位和32位轮)
    • 说明 : https : //www.webucator.com/blog/2015/03/installing-the-windows-64-bit-version-of-pygame/
    • 下载 : http : //www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
  • 从Windows二进制文件(仅限32位, .msi )安装Pygame: http : //www.pygame.org/download.shtml
  • 如果Docker和Vagrant一​​样(使用vms作为应用程序),则可以引入本地轮盘文件作为启动应用程序的一部分。
  • 将轮子上传到PyPi并使用pip来安装该软件包,但是之后有许可问题需要考虑和遵守。

目前pypi上的pygame是1.7.1,支持Windows 2000 / NT: https : //pypi.python.org/pypi/Pygame/1.7.1 ? – 也许你的Windows版本太新了。

我希望这已经回答了你的问题。