0

Python/Linux 初学者在这里!我使用 Codenvy ( https://codenvy.com/ ) 作为 PyGame 项目的 IDE。我用一行修改了我的 requirements.txt 文件:

pygame

但是当我尝试运行它时,我从控制台收到以下消息:

[DOCKER] Collecting pygame (from -r requirements.txt (line 1))
[DOCKER] Could not find any downloads that satisfy the requirement pygame (from -r requirements.txt (line 1))
[DOCKER] Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pygame to allow).
[DOCKER] No distributions at all found for pygame (from -r requirements.txt (line 1))
[DOCKER][ERROR] The command [/bin/sh -c cd /tmp/application && sudo virtualenv /env && sudo /env/bin/pip install -r requirements.txt] returned a non-zero code: 1
[ERROR] We are having trouble starting the runner and deploying application snakes_for_python. Either necessary files are missing or a fundamental configuration has changed.
Docker image build failed

我发现有另一篇文章记录了类似的问题,发现这意味着 Codenvy 没有我的依赖项(PyGame)。那篇文章中链接了两个文档:如何在 Codenvy 中构建自定义运行时以及如何构建自定义机器。

到目前为止,我已经将 Codenvy 的默认 Django + Python 2.7 docker 文件复制到一个新的 docker 文件中。我已经修改了程序用于从 requirements.txt 安装的行。这就是我现在所拥有的:

RUN cd /tmp/application && \
    sudo virtualenv /env && \
    sudo /env/bin/pip install -r requirements.txt && \
    sudo apt-get install python-pygame

最后的 && \ 是我自己添加的。不幸的是,我在这里得到了一个错误。

[DOCKER] The following NEW packages will be installed:
...
[DOCKER]ore-soundfont-gm python-numpy python-pygame tcpd x11-common
[DOCKER] 0 upgraded, 58 newly installed, 0 to remove and 12 not upgraded.
...
[DOCKER]ant to continue? [Y/n]
[DOCKER] Abort.
[DOCKER][ERROR] The command [/bin/sh -c cd /tmp/application && sudo virtualenv /env && sudo /env/bin/pip install -r requirements.txt && sudo apt-get install python-pygame] returned a non-zero code: 1
[ERROR] We are having trouble starting the runner and deploying application snakes_for_python. Either necessary files are missing or a fundamental configuration has changed.

有人可以解释为什么我收到中止声明吗?如果我用来安装 pygame 的命令不正确,它有什么不妥之处,我将如何修复它?

从那以后,我尝试使用该-y标志来自动确认选择(我相信这就是我中止的原因,按照打印到控制台的内容进行)。现在这是我的补充。

RUN sudo apt-get install python-pygame -y --fix-missing

我收到以下错误:

...
[DOCKER] Get:7 http://http.debian.net/debian/ jessie/main libcap-ng0 amd64 0.7.4-2 [13.2 kB]
[DOCKER] Err http://http.debian.net/debian/ jessie/main libdbus-1-3 amd64 1.8.16-1
[DOCKER]ot Found [IP: 108.59.10.97 80]
...
[DOCKER] Get:40 http://http.debian.net/debian/ jessie/main libjbig0 amd64 2.1-3.1 [30.7 kB]
[DOCKER] Err http://http.debian.net/debian/ jessie/main libtiff5 amd64 4.0.3-12.2
[DOCKER]ot Found [IP: 108.61.5.92 80]
...
[DOCKER] Get:46 http://http.debian.net/debian/ jessie/main libsmpeg0 amd64 0.4.5+cvs20030824-7.1 [91.3 kB
[DOCKER] Err http://http.debian.net/debian/ jessie/main libtiff5 amd64 4.0.3-12.2
[DOCKER] Not Found [IP: 108.61.5.92 80]
...
[DOCKER] Get:55 http://http.debian.net/debian/ jessie/main tcpd amd64 7.6.q-25 [22.9 kB]
[DOCKER] Fetched 23.1 MB in 6s (3407 kB/s)
[DOCKER]o correct missing packages.
[DOCKER] [91mE: Failed to fetch http://http.debian.net/debian/pool/main/d/dbus/libdbus-1-3_1.8.16-1_amd64.deb  404  Not Found [IP: 108.59.10.97 80]
[DOCKER]
[DOCKER] [91mFailed to fetch http://http.debian.net/debian/pool/main/t/tiff/libtiff5_4.0.3-12.2_amd64.deb  404  Not Found [IP: 108.61.5.92 80]
[DOCKER]d to fetch http://http.debian.net/debian/pool/main/d/dbus/dbus_1.8.16-1_amd64.deb  404  Not Found [IP: 108.61.5.92 80]
[DOCKER]ing install.
[DOCKER]
[DOCKER][ERROR] The command [/bin/sh -c sudo apt-get install python-pygame -y --fix-missing] returned a non-zero code: 100
[ERROR] We are having trouble starting the runner and deploying application snakes_for_python. Either necessary files are missing or a fundamental configuration has changed.
Docker image build failed

这些 404 与 debian 而不是 pygame 相关。我能做些什么来解决这个问题?

4

1 回答 1

0

尝试更新包管理器:

运行 sudo apt-get update && sudo apt-get install python-pygame -y

于 2015-09-28T06:50:26.837 回答