gpt4 book ai didi

pygame - Travis CI、pip 和 pygame

转载 作者:行者123 更新时间:2023-12-03 21:46:48 33 4
gpt4 key购买 nike

我正在尝试使用 Travis CI 设置一个项目。项目也使用 pygame。我曾多次尝试设置它 - 但它似乎失败了。

我得到的最接近的是以下内容:
.travis.yml :

language: python
python:
- "2.7"
install:
- pip install -r requirements.txt
before_install:
- sudo apt-get update
- sudo apt-get build-dep python-pygame
- sudo apt-get install mercurial
script:
- nosetests tests/*.py
requirements.txt :
Twisted==13.2.0
coverage==3.7.1
nose==1.3.0
hg+http://bitbucket.org/pygame/pygame
wsgiref==0.1.2
zope.interface==4.1.0

Travis CI下载了pygame包,但是安装挂了:

https://travis-ci.org/ruslanosipov/space/builds/19142164#L390

任何提示?

最佳答案

解决方法如下:

在没有 pygame 的情况下创建单独的 .travis_requirements.txt。

更改 .travis.yml如下:

language: python
python:
- "2.7"
before_install:
- sudo apt-get update -qq
- sudo apt-get build-dep -qq python-pygame
- sudo apt-get install -qq python-pygame
install:
- pip install -r .travis_requirements.txt
script:
- nosetests tests/*.py
virtualenv:
system_site_packages: true

主要变化是使用“system_site_packages”设置并通过 apt-get 安装 pygame。

关于pygame - Travis CI、pip 和 pygame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21866509/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com