首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Codenvy上安装PyGame

在Codenvy上安装PyGame
EN

Stack Overflow用户
提问于 2015-09-28 05:33:43
回答 1查看 880关注 0票数 0

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

代码语言:javascript
复制
pygame

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

代码语言:javascript
复制
[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 +Python2.7docker文件复制到了一个新的docker文件中。我已经修改了程序用来从requirements.txt安装的代码行。这就是我现在所拥有的:

代码语言:javascript
复制
RUN cd /tmp/application && \
    sudo virtualenv /env && \
    sudo /env/bin/pip install -r requirements.txt && \
    sudo apt-get install python-pygame

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

代码语言:javascript
复制
[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标志来自动确认选择(我相信这就是我得到中止的原因,根据打印到控制台的内容)。这是我现在添加的内容。

代码语言:javascript
复制
RUN sudo apt-get install python-pygame -y --fix-missing

我得到了以下错误:

代码语言:javascript
复制
...
[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有关。我能做些什么来解决这个问题呢?

EN

回答 1

Stack Overflow用户

发布于 2015-09-28 14:50:27

尝试更新包管理器:

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32813080

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档