메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


0. 아래 작업(0~7)은 root계정으로 진행한다.

*컴파일 환경준비

  - yum install zlib-devel -y
  - yum install openssl openssl-devel -y


1. 작업용 디렉토리생성하고 해당 폴더로 들어간다.

 mkdir /tmp/python

 cd /tmp/python




2. python3.5.1다운로드 받기(Gzipped source tarball)

https://www.python.org/downloads/release/python-351/에서 (Gzipped source tarball)를 클릭하여 소스를 다운로드 받아 작업 폴더(/tmp/python)에 업로드 한다.


3. 압축풀기

tar xvfz Python-3.5.1.tgz 


4. Python-3.5.1폴더로 이동한후 컴파일및 설치한다.

가. cd Python-3.5.1
나. ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
다. make && make altinstall


5. python3.5 버젼확인

> python3.5 -V => Python 3.5.1


5-1. python프로그램 실행 테스트

python3.5 /svc/apps/sda/ml/predict_.py 0000000003 dinner


6. pip3설치(python3은 pip3를 사용하고 python2는 pip를 사용해야함, 아래의 절차로 실행하면 python3.5에 맞는 pip가 설치되며 pip혹은 pip3 모두 같은 버젼이 실행되도록 설정됨)

가. curl -k -O https://bootstrap.pypa.io/get-pip.py
나. python3.5 get-pip.py

다. 확인 : pip --version check

* 로그내용

-bash-4.1# python3.5 get-pip.py
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 616kB/s 
Collecting wheel
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 15.8MB/s 
Installing collected packages: pip, wheel
  Found existing installation: pip 7.1.2
    Uninstalling pip-7.1.2:
      Successfully uninstalled pip-7.1.2
Successfully installed pip-9.0.1 wheel-0.30.0


7. numpy/pymysql설치

pip3 install numpy    <-(1.13.2가 설치되므로 python3를 사용하는 경우 아래의 내용을 참고하여 버젼업시켜준다.)

pip3 install pymysql


*참고 : numpy버젼 변경방법(예, 1.13.2를 1.9.2로 변경)

 가. pip3 install numpy==1.9.2

 나. pip3 install --upgrade --no-cache-dir  --force-reinstall scipy

 다. 진행 메세지

-bash-4.1# pip3 install numpy==1.9.2
Collecting numpy==1.9.2
  Downloading numpy-1.9.2-cp35-cp35m-manylinux1_x86_64.whl (15.0MB)
    100% |████████████████████████████████| 15.0MB 106kB/s
Installing collected packages: numpy
  Found existing installation: numpy 1.13.2
    Uninstalling numpy-1.13.2:
      Successfully uninstalled numpy-1.13.2
Successfully installed numpy-1.9.2




A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로