강좌/RaspberryPI 활용

Raspberry pi - Raspbian stretch python 3.7 설치

acidpop 2018. 9. 10. 10:46
반응형

 

 

1. 라이브러리 설치

 

sudo apt install -y libffi-dev libbz2-dev liblzma-dev \
    libsqlite3-dev libncurses5-dev libgdbm-dev zlib1g-dev \
    libreadline-dev libssl-dev tk-dev build-essential \
    libncursesw5-dev libc6-dev openssl git

 

2. Python 소스 다운로드

 

cd /home/pi

mkdir python_src

cd python_src

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

tar xvf Python-3.7.0.tgz

cd Python-3.7.0

 

3. Python 소스 컴파일

 

./configure

make -j 4   (이 값은 cpu core 갯수만큼 사용, core 가 2개라면 make -j 2)

sudo make install

 

 

4. pip 설치

 

cd /home/pi/python_src

 

wget https://bootstrap.pypa.io/get-pip.py

 

sudo python3.7 ./get-pip.py