読者です 読者をやめる 読者になる 読者になる

IT練習ノート

IT関連で調べたこと(実際は嵌ったこと)を書いています。

ggplotインストールと動作確認

インストールログ
wk$ pyenv install -l

Available versions:

  2.1.3

  2.2.3

  2.3.7

  2.4

  2.4.1

  2.4.2

  2.4.3

  2.4.4

  2.4.5

  2.4.6

  2.5

  2.5.1

  2.5.2

  2.5.3

  2.5.4

  2.5.5

  2.5.6

  2.6.6

  2.6.7

  2.6.8

  2.6.9

  2.7-dev

  2.7

  2.7.1

  2.7.2

  2.7.3

  2.7.4

  2.7.5

  2.7.6

  2.7.7

  2.7.8

  2.7.9

  2.7.10

  3.0.1

  3.1

  3.1.1

  3.1.2

  3.1.3

  3.1.4

  3.1.5

  3.2-dev

  3.2

  3.2.1

  3.2.2

  3.2.3

  3.2.4

  3.2.5

  3.2.6

  3.3.0

  3.3-dev

  3.3.1

  3.3.2

  3.3.3

  3.3.4

  3.3.5

  3.3.6

  3.4.0

  3.4-dev

  3.4.1

  3.4.2

  3.4.3

  3.5.0b1

  3.5.0b2

  3.5.0b3

  3.5-dev

  3.6-dev

  anaconda-1.4.0

  anaconda-1.5.0

  anaconda-1.5.1

  anaconda-1.6.0

  anaconda-1.6.1

  anaconda-1.7.0

  anaconda-1.8.0

  anaconda-1.9.0

  anaconda-1.9.1

  anaconda-1.9.2

  anaconda-2.0.0

  anaconda-2.0.1

  anaconda-2.1.0

  anaconda-2.2.0

  anaconda-2.3.0

  anaconda3-2.0.0

  anaconda3-2.0.1

  anaconda3-2.1.0

  anaconda3-2.2.0

  anaconda3-2.3.0

  ironpython-dev

  ironpython-2.7.4

  ironpython-2.7.5

  jython-dev

  jython-2.5.0

  jython-2.5-dev

  jython-2.5.1

  jython-2.5.2

  jython-2.5.3

  jython-2.5.4-rc1

  jython-2.7.0

  miniconda-2.2.2

  miniconda-3.0.0

  miniconda-3.0.4

  miniconda-3.0.5

  miniconda-3.3.0

  miniconda-3.4.2

  miniconda-3.7.0

  miniconda-3.8.3

  miniconda-3.9.1

  miniconda3-2.2.2

  miniconda3-3.0.0

  miniconda3-3.0.4

  miniconda3-3.0.5

  miniconda3-3.3.0

  miniconda3-3.4.2

  miniconda3-3.7.0

  miniconda3-3.8.3

  miniconda3-3.9.1

  pypy-c-jit-latest

  pypy-c-nojit-latest

  pypy-dev

  pypy-portable-2.3.1

  pypy-portable-2.4

  pypy-portable-2.5

  pypy-portable-2.5.1

  pypy-portable-2.6.0

  pypy-1.5-src

  pypy-1.5

  pypy-1.6

  pypy-1.7-dev

  pypy-1.7

  pypy-1.8-dev

  pypy-1.8

  pypy-1.9-dev

  pypy-1.9

  pypy-2.0-dev

  pypy-2.0-src

  pypy-2.0

  pypy-2.0.1-src

  pypy-2.0.1

  pypy-2.0.2-src

  pypy-2.0.2

  pypy-2.1-src

  pypy-2.1

  pypy-2.2-src

  pypy-2.2

  pypy-2.2.1-src

  pypy-2.2.1

  pypy-2.3-src

  pypy-2.3

  pypy-2.3.1-src

  pypy-2.3.1

  pypy-2.4.0-src

  pypy-2.4.0

  pypy-2.4-beta1-src

  pypy-2.4-beta1

  pypy-2.5.0-src

  pypy-2.5.0

  pypy-2.5.1-src

  pypy-2.5.1

  pypy-2.6.0-src

  pypy-2.6.0

  pypy3-dev

  pypy3-portable-2.3.1

  pypy3-portable-2.4

  pypy3-2.3.1-src

  pypy3-2.3.1

  pypy3-2.4.0-src

  pypy3-2.4.0

  stackless-dev

  stackless-2.7-dev

  stackless-2.7.2

  stackless-2.7.3

  stackless-2.7.4

  stackless-2.7.5

  stackless-2.7.6

  stackless-2.7.7

  stackless-2.7.8

  stackless-3.2-dev

  stackless-3.2.2

  stackless-3.2.5

  stackless-3.3-dev

  stackless-3.3.5

  stackless-3.4.1

wk$ pyenv install anaconda3-2.3.0

Downloading Anaconda3-2.3.0-MacOSX-x86_64.sh...

-> http://repo.continuum.io/archive/Anaconda3-2.3.0-MacOSX-x86_64.sh

Installing Anaconda3-2.3.0-MacOSX-x86_64...

Installed Anaconda3-2.3.0-MacOSX-x86_64 to /Users/wk/.pyenv/versions/anaconda3-2.3.0



wk$ pyenv versions

  system

* 3.4.3 (set by /Users/wk/.pyenv/version)

  anaconda3-2.3.0

wk$ pyenv global anaconda3-2.3.0

pyenv-virtualenv: activate anaconda3-2.3.0

discarding /Users/wk/.pyenv/versions/anaconda3-2.3.0/bin from PATH

prepending /Users/wk/.pyenv/versions/anaconda3-2.3.0/bin to PATH

(root)wk$ pyenv versions

  system

  3.4.3

* anaconda3-2.3.0 (set by /Users/wk/.pyenv/version)

(root)wk$ conda install pandasql

Fetching package metadata: 

....

Solving package specifications: ...............

Package plan for installation in environment /Users/wk/.pyenv/versions/anaconda3-2.3.0:



The following packages will be downloaded:



    package                    |            build

    ---------------------------|-----------------

    conda-env-2.3.0            |           py34_0          24 KB

    numpy-1.8.2                |           py34_0         2.6 MB

    scipy-0.14.0               |       np18py34_0        10.6 MB

    setuptools-18.0.1          |           py34_0         345 KB

    sqlparse-0.1.7             |           py34_0          72 KB

    conda-3.15.1               |           py34_0         175 KB

    dateutil-2.4.1             |           py34_0         219 KB

    pip-7.1.0                  |           py34_0         1.4 MB

    pandas-0.14.1              |       np18py34_0         4.2 MB

    pandasql-0.4.2             |       np18py34_0          21 KB

    ------------------------------------------------------------

                                           Total:        19.7 MB



The following NEW packages will be INSTALLED:



    dateutil:   2.4.1-py34_0     

    pandasql:   0.4.2-np18py34_0 

    sqlparse:   0.1.7-py34_0     



The following packages will be UPDATED:



    conda:      3.14.1-py34_0     --> 3.15.1-py34_0    

    conda-env:  2.2.3-py34_0      --> 2.3.0-py34_0     

    pip:        7.0.3-py34_0      --> 7.1.0-py34_0     

    setuptools: 17.1.1-py34_0     --> 18.0.1-py34_0    



The following packages will be DOWNGRADED:



    numpy:      1.9.2-py34_0      --> 1.8.2-py34_0     

    pandas:     0.16.2-np19py34_0 --> 0.14.1-np18py34_0

    scipy:      0.15.1-np19py34_0 --> 0.14.0-np18py34_0



Proceed ([y]/n)? 

Fetching packages ...

conda-env-2.3. 100% |############################################################################################################################################################| Time: 0:00:00  78.04 kB/s

numpy-1.8.2-py 100% |############################################################################################################################################################| Time: 0:00:12 211.62 kB/s

scipy-0.14.0-n 100% |############################################################################################################################################################| Time: 0:00:19 582.94 kB/s

setuptools-18. 100% |############################################################################################################################################################| Time: 0:00:03 116.89 kB/s

sqlparse-0.1.7 100% |############################################################################################################################################################| Time: 0:00:01  70.90 kB/s

conda-3.15.1-p 100% |############################################################################################################################################################| Time: 0:00:01 102.85 kB/s

dateutil-2.4.1 100% |############################################################################################################################################################| Time: 0:00:02  83.20 kB/s

pip-7.1.0-py34 100% |############################################################################################################################################################| Time: 0:00:06 239.13 kB/s

pandas-0.14.1- 100% |############################################################################################################################################################| Time: 0:00:13 338.15 kB/s

pandasql-0.4.2 100% |############################################################################################################################################################| Time: 0:00:00  50.54 kB/s

Extracting packages ...

[      COMPLETE      ]|###############################################################################################################################################################################| 100%

Unlinking packages ...

[      COMPLETE      ]|###############################################################################################################################################################################| 100%

Linking packages ...

[      COMPLETE      ]|###############################################################################################################################################################################| 100%

(root)wk$ pip install ggplot

Collecting ggplot

  Downloading ggplot-0.6.5.tar.gz (8.4MB)

    100% |████████████████████████████████| 8.4MB 23kB/s 

Requirement already satisfied (use --upgrade to upgrade): six in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from ggplot)

Requirement already satisfied (use --upgrade to upgrade): statsmodels in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from ggplot)

Collecting brewer2mpl (from ggplot)

  Downloading brewer2mpl-1.4.1-py2.py3-none-any.whl

Requirement already satisfied (use --upgrade to upgrade): matplotlib in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from ggplot)

Requirement already satisfied (use --upgrade to upgrade): scipy in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from ggplot)

Requirement already satisfied (use --upgrade to upgrade): patsy in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from ggplot)

Requirement already satisfied (use --upgrade to upgrade): pandas in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from ggplot)

Requirement already satisfied (use --upgrade to upgrade): numpy in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from ggplot)

Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from matplotlib->ggplot)

Requirement already satisfied (use --upgrade to upgrade): pytz in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from matplotlib->ggplot)

Requirement already satisfied (use --upgrade to upgrade): pyparsing>=1.5.6 in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from matplotlib->ggplot)

Requirement already satisfied (use --upgrade to upgrade): nose>=0.11.1 in /Users/wk/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages (from matplotlib->ggplot)

Installing collected packages: brewer2mpl, ggplot

  Running setup.py install for ggplot

Successfully installed brewer2mpl-1.4.1 ggplot-0.6.5

(root)wk$ 

この後に 

pip install husl

をする。
動作確認コーディング
from pandas import *
from ggplot import *

import pandas

df = pandas.read_csv('hr_year.csv')
p = ggplot(df, aes('yearID', 'HR')) + geom_point(color = 'red') + geom_line(color='red') + ggtitle('title') + xlab('x-label') + ylab('y-label')
ggsave(p,'test.png')
test$ python test.py 
Saving 11.0 x 8.0 in image.
test01$ ls 
__pycache__ hr_year.csv test.png    test.py