# 2.1.3 라즈베리파이 셋업

1. 라이브러리 설치

```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential python3 python3-dev python3-pip python3-virtualenv python3-numpy python3-picamera 
sudo apt-get install python3-pandas python3-rpi.gpio i2c-tools avahi-utils joystick libopenjp2-7-dev libtiff5-dev gfortran 
sudo apt-get install libatlas-base-dev libopenblas-dev libhdf5-serial-dev git ntp
```

2\. OpenCV를 위한 라이브러리 설치

```
sudo apt-get install libilmbase-dev libopenexr-dev libgstreamer1.0-dev libjasper-dev libwebp-dev 
sudo apt-get install libatlas-base-dev libavcodec-dev libavformat-dev libswscale-dev libqtgui4 libqt4-test
```

3\. 가상 개발환경 설정

```
python3 -m virtualenv -p python3 env --system-site-packages
echo "source env/bin/activate" >> ~/.bashrc
source ~/.bashrc
```

4\. 동키카 파이썬 코드 설치

```
mkdir projects
cd ~/projects

git clone https://github.com/waveshare/donkeycar
cd donkeycar
git checkout dev
pip install -e .[pi]
pip install tensorflow==1.13.1
```

5\. 텐서 플로우 설치 확인

```
python -c "import tensorflow"

아래와 같은 경우는 일반적인 경우이다.
/home/pi/env/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.4 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
  return f(*args, **kwds)
/home/pi/env/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 432, got 412
  return f(*args, **kwds)
```

6\. OpenCV를 설치한다.

```
sudo apt install python3-opencv

만약에 문제가 있다면, 아래 명령을 실행한다.
pip install opencv-python
```

7\. 동작을 확인한다.

```
python -c "import cv2"
```

8\. OLED Display 서비스를 설치한다.

```
cd ~
git clone https://github.com/waveshare/pi-display
cd pi-display
sudo ./install.sh
```

9\. 동키카를 생성한다.

```
donkey createcar --path ~/mycar
```

10\. 만약 numpy에러가 발생하면, 적당한 버전으로 재 설치해 주어야 한다.

```
pip install numpy==1.17.3
```


---

# 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://robertchoi.gitbook.io/jetracer/2.1/2.1.2.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.
