아래 python hompage에서 file download.

https://www.python.org/downloads/

 

Download Python

The official home of the Python Programming Language

www.python.org

개인적으로는 gzip source tarball을 선택하여 download.

gzip source tarball을 선택

아래 명령 실행

set download = Python-3.9.12
# 3.9.12 -> 3.9
set symlink = `echo ${util} | sed 's/(.*\)\.[0-9]\+$/\1/'`
# 압축해제
tar xfz ${download}.tgz
# ln -s는 3.9버전 업그레이드를 대비. 3.9로 symbolic 링크
# shell에 path는 3.9를 기준으로 bin을 path에 등록하였다.
pushd ${download} && \
    ./configure --prefix=${INSTALL_DIR}/${download} --enable-shared --enable-optimizations && \
    make && \
    make install && \
    ln -s ${INSTALL_DIR}/${download} ${INSTALL_DIR}/${symlink} \
popd

Shell script에 bin path 및 library path 등록 ( 아래는 cshell 기준으로 ~/.cshrc  )

set path = ( ${INSTALL_DIR}${symlink}/bin $path )
setenv LD_LIBRARY_PATH ${INSTALL_DIR}${symlink}/lib:$LD_LIBRARY_PATH

cshrc를 sourcing 하거나, terminal을 새롭게 ( cshrc를 새롭게 sourcing 하는 효과 ) 실행

source ~/.cshrc

python이 잘 실행되는지 체크

$ which python3
~~~/bin/python3
$ python3
Python 3.9.12 (main, Aug ....
....

'python' 카테고리의 다른 글

구구단 - 파이썬  (0) 2023.06.03
Python FTP TLS implicit  (0) 2022.09.24
How do I add comments to JSON ?  (0) 2022.09.24
Python package install ( offline )  (0) 2022.09.24

+ Recent posts