суббота, 6 сентября 2014 г.

Установка некоторых пакетов python на arch linux

$ sudo pip install ipython

[angor@omega ~]$ ipython
Python 3.4.1 (default, May 19 2014, 17:23:49)
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]:



$ sudo pip install numpy

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>



$ sudo pip install matplotlib

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>>



$ sudo pacman -S core/gcc-fortran
$ sudo pip install scipy


или
$ sudo pacman -S scipy

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>>



$ sudo pacman -S extra/python-pyqt5

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>>


$ sudo pacman -S python-opengl

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from OpenGL.GL import *
>>> from OpenGL.GLU import *
>>> from OpenGL.GLUT import *
>>>


$ sudo pip install django

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>>


$ sudo pip install pyramid

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyramid
>>>


$ sudo pip install tornado

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tornado
>>>


$ sudo pacman -S python-sip


[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sip
>>>



$ sudo pip install pillow

[angor@omega ~]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
>>>


Есть такая книга:
http://flaskbook.com/

Чтобы выполнить примеры из неё, необходимо установить следующие пакеты:

sudo pip install flask flask-script flask-bootstrap flask-moment flask-wtf flask-sqlalchemy flask-migrate flask-mail flask-login forgerypy flask-pagedown markdown bleach flask-httpauth httpie coverage selenium gunicorn







Установка пакета pygame на arch linux

1. Загружаем tarball python-pygame-hg.tar.gz с сайта:

https://aur.archlinux.org/packages/python-pygame-hg/ 

2. Распакуем архив в текущую папку:

tar -xvf  python-pygame-hg.tar.gz 

или в другую папку:
tar -C /myfolder -xvf  python-pygame-hg.tar.gz

3. Перейдем в каталог:

cd  python-pygame-hg

4. Смотрим зависимости:

$ more .AURINFO
pkgbase = python-pygame-hg
        pkgdesc = Python game library
        pkgver = r3349.823708f24a3a
        pkgrel = 1
        url = http://pygame.org/
        arch = i686
        arch = x86_64
        license = LGPL
        makedepends = mercurial
        makedepends = python-setuptools
        depends = python
        depends = libjpeg-turbo
        depends = sdl_ttf
        depends = sdl_image
        depends = sdl_mixer
        depends = portmidi
        provides = python3-pygame
        provides = python3-pygame-svn
        conflicts = python3-pygame
        conflicts = python3-pygame-svn
        replaces = python3-pygame-svn
        source = python-pygame-hg::hg+https://bitbucket.org/pygame/pygame

pkgname = python-pygame-hg

$
 
$ more PKGBUILD
# Maintainer: speps

pkgname=python-pygame-hg
pkgver=r3349.823708f24a3a
pkgrel=1
pkgdesc="Python game library"
arch=(i686 x86_64)
url="http://pygame.org/"
license=('LGPL')
depends=('python' 'libjpeg-turbo' 'sdl_ttf'
         'sdl_image' 'sdl_mixer' 'portmidi')
makedepends=('mercurial' 'python-setuptools')
provides=('python3-pygame' 'python3-pygame-svn')
conflicts=('python3-pygame' 'python3-pygame-svn')
replaces=('python3-pygame-svn')
source=("$pkgname::hg+https://bitbucket.org/pygame/pygame")
md5sums=('SKIP')

pkgver() {
  cd $pkgname
  printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
}

build() {
  cd $pkgname
  python config.py -auto
  python setup.py build
}

package() {
  cd $pkgname
  python setup.py install --prefix=/usr \
                          --root="$pkgdir/"
}

# vim:set ts=2 sw=2 et:
$

5. Устанавливаем зависимые пакеты:
 
$ sudo pacman -S mercurial  python-setuptools  libjpeg-turbo  sdl_ttf  sdl_image  sdl_mixer  portmidi

6. Устанавливаем pygame:

$ makepkg

$ sudo pacman -U *.pkg.tar.xz

7. Проверяем:

$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
>>>