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
我发现有another post that documented a similar problem,发现这意味着Codenvy没有我的依赖(PyGame)。该帖子中链接了两个文档:how to build a custom runtime in 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的命令不正确,那么它的不当之处是什么,以及如何修复它?
编辑1:
我试图使用-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有关。我该怎么做才能解决这个问题?
答案 0 :(得分:0)
尝试更新包管理器:
RUN sudo apt-get update&& sudo apt-get install python-pygame -y