2019年4月15日月曜日

pythonの環境管理

取り急ぎ、メモだけ。
$ pyenv versions
* system (set by /Users/hisawo/.pyenv/version)
$ pyenv install anaconda3-5.3.1
Installing Anaconda3-5.3.1-MacOSX-x86_64.sh...
Installed Anaconda3-5.3.1-MacOSX-x86_64.sh to /Users/hisawo/.pyenv/versions/anaconda3-5.3.1

$ pyenv versions
* system (set by /Users/hisawo/.pyenv/version)
  anaconda3-5.3.1
$
[続きを読む]
取り急ぎ、メモだけ。
$ pyenv versions
* system (set by /Users/hisawo/.pyenv/version)
$ pyenv install anaconda3-5.3.1
Installing Anaconda3-5.3.1-MacOSX-x86_64.sh...
Installed Anaconda3-5.3.1-MacOSX-x86_64.sh to /Users/hisawo/.pyenv/versions/anaconda3-5.3.1

$ pyenv versions
* system (set by /Users/hisawo/.pyenv/version)
  anaconda3-5.3.1
$
$ pyenv activate anaconda3-5.3.1
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(anaconda3-5.3.1) $ export PYENV_VIRTUALENV_DISABLE_PROMPT=1
(anaconda3-5.3.1) $
(anaconda3-5.3.1) $ conda create -n pythonstan
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.11
  latest version: 4.6.11

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /Users/hisawo/.pyenv/versions/anaconda3-5.3.1/envs/pythonstan


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate pythonstan
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(anaconda3-5.3.1) $ conda info -e
# conda environments:
#
base                     /Users/hisawo/.pyenv/versions/anaconda3-5.3.1
pythonstan               /Users/hisawo/.pyenv/versions/anaconda3-5.3.1/envs/pythonstan

(anaconda3-5.3.1) $
(anaconda3-5.3.1) $ conda activate pythonstan
(pythonstan) (anaconda3-5.3.1) $ conda install -c conda-forge pystan
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.11
  latest version: 4.6.11

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /Users/hisawo/.pyenv/versions/anaconda3-5.3.1/envs/pythonstan

  added / updated specs:
    - pystan


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    llvm-lto-tapi-4.0.1        |       h6701bc3_0        11.7 MB  conda-forge
    xz-5.2.4                   |    h1de35cc_1001         268 KB  conda-forge
    wheel-0.33.1               |           py37_0          34 KB  conda-forge
    compiler-rt-4.0.1          |       h5487866_0         963 KB  conda-forge
    clangxx-4.0.1              |       hc9b4283_0          10 KB
    cython-0.29.6              |   py37h0a44026_0         2.0 MB  conda-forge
    python-3.7.3               |       h0d93f26_0        20.7 MB  conda-forge
    sqlite-3.26.0              |    h1765d9f_1001         2.4 MB  conda-forge
    pystan-2.17.1.0            |py37h1702cab_1003        14.2 MB  conda-forge
    setuptools-41.0.0          |           py37_0         620 KB  conda-forge
    libgfortran-3.0.1          |                0         495 KB  conda-forge
    cctools-895                |       h7512d6f_0         1.5 MB  conda-forge
    tk-8.6.9                   |    ha441bb4_1001         3.2 MB  conda-forge
    zlib-1.2.11                |    h1de35cc_1004         101 KB  conda-forge
    clangxx_osx-64-4.0.1       |      h22b1bf0_11           7 KB
    pip-19.0.3                 |           py37_0         1.8 MB  conda-forge
    cycler-0.10.0              |             py_1           8 KB  conda-forge
    libffi-3.2.1               |    h6de7cb9_1006          43 KB  conda-forge
    freetype-2.10.0            |       h24853df_0         881 KB  conda-forge
    tornado-6.0.2              |   py37h01d97ff_0         635 KB  conda-forge
    clang_osx-64-4.0.1         |      h1ce6c1d_11           7 KB
    python-dateutil-2.8.0      |             py_0         219 KB  conda-forge
    libpng-1.6.36              |    ha441bb4_1000         306 KB  conda-forge
    ncurses-6.1                |    h0a44026_1002         1.3 MB  conda-forge
    kiwisolver-1.0.1           |py37h04f5b5a_1002          56 KB  conda-forge
    six-1.12.0                 |        py37_1000          22 KB  conda-forge
    clang-4.0.1                |       h662ec87_0        73.7 MB  conda-forge
    llvm-4.0.1                 |       hc748206_0       136.7 MB  conda-forge
    bzip2-1.0.6                |    h1de35cc_1002         148 KB  conda-forge
    pyparsing-2.4.0            |             py_0          55 KB  conda-forge
    readline-7.0               |    hcfe32e1_1001         393 KB  conda-forge
    ld64-274.2                 |       h7c2db76_0         2.6 MB  conda-forge
    ------------------------------------------------------------
                                           Total:       276.8 MB

The following NEW packages will be INSTALLED:

    bzip2:           1.0.6-h1de35cc_1002        conda-forge
    ca-certificates: 2019.3.9-hecc5488_0        conda-forge
    cctools:         895-h7512d6f_0             conda-forge
    certifi:         2019.3.9-py37_0            conda-forge
    clang:           4.0.1-h662ec87_0           conda-forge
    clang_osx-64:    4.0.1-h1ce6c1d_11
    clangxx:         4.0.1-hc9b4283_0
    clangxx_osx-64:  4.0.1-h22b1bf0_11
    compiler-rt:     4.0.1-h5487866_0           conda-forge
    cycler:          0.10.0-py_1                conda-forge
    cython:          0.29.6-py37h0a44026_0      conda-forge
    freetype:        2.10.0-h24853df_0          conda-forge
    kiwisolver:      1.0.1-py37h04f5b5a_1002    conda-forge
    ld64:            274.2-h7c2db76_0           conda-forge
    libblas:         3.8.0-4_openblas           conda-forge
    libcblas:        3.8.0-4_openblas           conda-forge
    libcxx:          4.0.1-h579ed51_0
    libcxxabi:       4.0.1-hebd6815_0
    libffi:          3.2.1-h6de7cb9_1006        conda-forge
    libgfortran:     3.0.1-0                    conda-forge
    liblapack:       3.8.0-4_openblas           conda-forge
    libpng:          1.6.36-ha441bb4_1000       conda-forge
    llvm:            4.0.1-hc748206_0           conda-forge
    llvm-lto-tapi:   4.0.1-h6701bc3_0           conda-forge
    matplotlib:      3.0.3-py37_0               conda-forge
    matplotlib-base: 3.0.3-py37hf043ca5_0       conda-forge
    ncurses:         6.1-h0a44026_1002          conda-forge
    numpy:           1.16.2-py37hbb3c62a_1      conda-forge
    openblas:        0.3.5-h436c29b_1001        conda-forge
    openssl:         1.1.1b-h01d97ff_2          conda-forge
    pip:             19.0.3-py37_0              conda-forge
    pyparsing:       2.4.0-py_0                 conda-forge
    pystan:          2.17.1.0-py37h1702cab_1003 conda-forge
    python:          3.7.3-h0d93f26_0           conda-forge
    python-dateutil: 2.8.0-py_0                 conda-forge
    readline:        7.0-hcfe32e1_1001          conda-forge
    setuptools:      41.0.0-py37_0              conda-forge
    six:             1.12.0-py37_1000           conda-forge
    sqlite:          3.26.0-h1765d9f_1001       conda-forge
    tk:              8.6.9-ha441bb4_1001        conda-forge
    tornado:         6.0.2-py37h01d97ff_0       conda-forge
    wheel:           0.33.1-py37_0              conda-forge
    xz:              5.2.4-h1de35cc_1001        conda-forge
    zlib:            1.2.11-h1de35cc_1004       conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
llvm-lto-tapi-4.0.1  | 11.7 MB   | ##################################### | 100%
xz-5.2.4             | 268 KB    | ##################################### | 100%
wheel-0.33.1         | 34 KB     | ##################################### | 100%
compiler-rt-4.0.1    | 963 KB    | ##################################### | 100%
clangxx-4.0.1        | 10 KB     | ##################################### | 100%
cython-0.29.6        | 2.0 MB    | ##################################### | 100%
python-3.7.3         | 20.7 MB   | ##################################### | 100%
sqlite-3.26.0        | 2.4 MB    | ##################################### | 100%
pystan-2.17.1.0      | 14.2 MB   | ##################################### | 100%
setuptools-41.0.0    | 620 KB    | ##################################### | 100%
libgfortran-3.0.1    | 495 KB    | ##################################### | 100%
cctools-895          | 1.5 MB    | ##################################### | 100%
tk-8.6.9             | 3.2 MB    | ##################################### | 100%
zlib-1.2.11          | 101 KB    | ##################################### | 100%
clangxx_osx-64-4.0.1 | 7 KB      | ##################################### | 100%
pip-19.0.3           | 1.8 MB    | ##################################### | 100%
cycler-0.10.0        | 8 KB      | ##################################### | 100%
libffi-3.2.1         | 43 KB     | ##################################### | 100%
freetype-2.10.0      | 881 KB    | ##################################### | 100%
tornado-6.0.2        | 635 KB    | ##################################### | 100%
clang_osx-64-4.0.1   | 7 KB      | ##################################### | 100%
python-dateutil-2.8. | 219 KB    | ##################################### | 100%
libpng-1.6.36        | 306 KB    | ##################################### | 100%
ncurses-6.1          | 1.3 MB    | ##################################### | 100%
kiwisolver-1.0.1     | 56 KB     | ##################################### | 100%
six-1.12.0           | 22 KB     | ##################################### | 100%
clang-4.0.1          | 73.7 MB   | ##################################### | 100%
llvm-4.0.1           | 136.7 MB  | ##################################### | 100%
bzip2-1.0.6          | 148 KB    | ##################################### | 100%
pyparsing-2.4.0      | 55 KB     | ##################################### | 100%
readline-7.0         | 393 KB    | ##################################### | 100%
ld64-274.2           | 2.6 MB    | ##################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(pythonstan) (anaconda3-5.3.1) $
2020-05-11追記:
home brew でインストールしておくパッケージ
  • python
  • python@2
  • python@3.8
  • pyenv
  • pyenv-virtualenv