# oTreeのインストールと起動：

oTreeのインストールは非常に単純です．

Windowsの場合はPowershell，Macの場合はターミナルで以下のコードを打ってください．

```
pip3 install -U otree
```

※ 20200115 oTreeのオフィシャルホームページではこのように書かれていますが，こっちの方が良さそうです．

```
pip install -U otree
```

これでもうまくいかない場合には，Pathが通っていない可能性があります．

これだけでインストールはできます．

さらに，otreeを起動したい場合は最初に「プロジェクト」を作ります．

デスクトップに移動した後に，以下のコードを打ってください．

```
otree startproject oTree
```

このコードによって，いくつかのサンプルとして用意されているゲームを利用することができます．

ちなみに，上のコードではホームディレクトリに「oTree」という名前のディレクトリが作られることになります．

続いて，このディレクトリに移動してあげる必要があります．

```
cd oTree
```

移動したら，以下のコードを打ってください．

詳細は改めて書きますが，このコードを打つことでoTreeのデータベースが設定されます．

otree resetdb 途中で，「データベースをリセットするけどいいかい？イイなら"y"を，ダメなら"n"を入力してからエンターを押してください」って言われるので，"y"を入力してからエンターを押してください．

その後に

```
otree runserver
```

と打ち込めば，`http://127.0.0.1:8000/`でローカル（端末上）にてoTreeを動かすことができます．

※20200115最新版だとコードが少し違うようです．

```
otree devserver
```

※私はDropbox上にoTreeフォルダを作っています．そうすることでクラウド上でのサーバも動かせるようにしています．．．

が，そんな話はまた改めて．

\========================================================================

ちなみに，この辺の話は以下サイトに書いてあったりします．

<http://otree.readthedocs.io/en/latest/index.html>

このサイトを参考にして，oTreeの使い方を紹介していきたいと思います．


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://akrgt.gitbook.io/otree-jp/i/otreenoinsutruto.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
