简体   繁体   English

在Eclipse Indigo,Ubuntu 10.04和Python 2.7上使用Kivy

[英]Using Kivy on Eclipse Indigo, Ubuntu 10.04 & Python 2.7

I would like to use Kivy on Eclipse Indigo on Ubuntu 10.04. 我想在Ubuntu 10.04的Eclipse Indigo上使用Kivy。 I understand that python 2.7 is required (2.6 is the default on 10.04) and have python 2.7 installed as well. 我知道python 2.7是必需的(2.6是10.04的默认设置),并且也安装了python 2.7。 I've done lots of research but not found an answer. 我做了很多研究,但没有找到答案。 Can I do this and if so how? 我可以这样做吗? I don't want to upgrade ubuntu nor Eclipse since this would probably destabilise existing developments. 我不想升级ubuntu或Eclipse,因为这可能会破坏现有开发的稳定性。

Kivy and Eclipse are not related, and Eclipse is not necessary for running or editing Kivy programs. Kivy和Eclipse不相关,并且Eclipse对于运行或编辑Kivy程序不是必需的。 I can help to answer the Kivy part of your question, and will leave Eclipse to others. 我可以帮助回答您问题的Kivy部分,并将Eclipse留给其他人。

Since Ubuntu 10.04 is out of support, it's hard to tell which required system packages are not available. 由于Ubuntu 10.04不在支持范围内,因此很难确定哪些必需的系统软件包不可用。 This will probably be the most tedious part of the process. 这可能是该过程中最繁琐的部分。 For Kivy on Ubuntu 12.04 you need: 对于Ubuntu 12.04上的Kivy,您需要:

sudo apt-get install -y build-essential mercurial git python2.7 python-dev ccache ffmpeg libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev unzip

Some of those packages will have different versions on Ubuntu 10.04. 其中一些软件包在Ubuntu 10.04上将具有不同的版本。 Hopefully they are all available in some form. 希望它们都可以以某种形式提供。

Next you need to bootstrap an up-to-date Python setuptools environment: 接下来,您需要引导一个最新的Python setuptools环境:

sudo apt-get remove --purge -y python-virtualenv python-pip python-setuptools
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python2.7
rm -f setuptools*.zip
sudo easy_install-2.7 -U pip

Now you can install an up-to-date Cython: 现在,您可以安装最新的Cython:

sudo apt-get remove --purge -y cython
sudo pip2.7 install -U cython

Next you can install an up-to-date NumPy, which is required for PyGame: 接下来,您可以安装最新的NumPy,这对于PyGame是必需的:

sudo apt-get remove --purge -y python-numpy
sudo pip2.7 install -U numpy

Now you can install an up-to-date PyGame: 现在,您可以安装最新的PyGame:

sudo apt-get remove --purge -y python-pygame
hg clone https://bitbucket.org/pygame/pygame
cd pygame
python2.7 setup.py build
sudo python2.7 setup.py install
cd ..
sudo rm -rf pygame

Now that all of the dependencies are met, you can install an up-to-date Kivy: 现在已经满足了所有依赖性,您可以安装最新的Kivy:

sudo apt-get remove --purge -y python-kivy
sudo pip install -U kivy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM