PYTHON 프로그래밍

본문 바로가기
사이트 내 전체검색


PYTHON 프로그래밍
PYTHON 프로그래밍

5. Python pip 를 일반계정에 설치하는 방법

페이지 정보

작성자 관리자 댓글 0건 조회 3,537회 작성일 18-12-24 19:20

본문

5. Python pip 를 일반계정에 설치하는 방법

시스템을 운영하다 보면 Python 을 많이 사용하게 되는데, 리눅스 시스템의 경우에 기본적으로 Python 이 설치되어 있다. 하지만 pip 는 기본적으로 설치되지 않는데 이것을 설처하기 위해서 리눅스 시스템의 슈퍼유저인 root 사용자 계정을 빌리거나 설치 요청을 하는 경우가 많다.

하지만 일반계정으로 pip 를 사용할 수 있는데 이에 대해 간단히 소개한다.


$ mkdir -p ~/.local/bin
$
$ echo "export PATH=\$PATH:~/.local/bin" >> .bashrc
$ source .bashrc
$ wget https://bootstrap.pypa.io/get-pip.py
--2018-12-24 19:01:13--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.228.175, 2a04:4e42:11::175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.228.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1661676 (1.6M) [text/x-python]
Saving to: ‘get-pip.py’

100%[======================================>] 1,661,676   1.57MB/s   in 1.0s

2018-12-24 19:01:15 (1.57 MB/s) - ‘get-pip.py’ saved [1661676/1661676]

$ python get-pip.py --user
Collecting pip
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 7.1MB/s
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Successfully installed pip-18.1 wheel-0.32.3
$ pip install scipy --user
Collecting scipy
  Downloading https://files.pythonhosted.org/packages/45/d1/7c2b33a5daee3d67752d043fe7e1476c4465788b0b6e59367fd71fdf684a/scipy-1.2.0-cp27-cp27mu-manylinux1_x86_64.whl (26.6MB)
    100% |████████████████████████████████| 26.6MB 466kB/s
Collecting numpy>=1.8.2 (from scipy)
  Downloading https://files.pythonhosted.org/packages/de/37/fe7db552f4507f379d81dcb78e58e05030a8941757b1f664517d581b5553/numpy-1.15.4-cp27-cp27mu-manylinux1_x86_64.whl (13.8MB)
    100% |████████████████████████████████| 13.8MB 1.1MB/s
Installing collected packages: numpy, scipy
Successfully installed numpy-1.15.4 scipy-1.2.0


이렇게 하면 pip 관련된 파일들이 ~/.local/bin 디렉토리에 생성된다. 관련 라이브러리들도 ~/.local/lib 함께 생성된다.

pip 를 이용해 패키지를 설치할때도 역시 다음과 같이 –user 옵션을 이용한다.

댓글목록

등록된 댓글이 없습니다.


개인정보취급방침 서비스이용약관 모바일 버전으로 보기 상단으로

TEL. 063-469-4551 FAX. 063-469-4560 전북 군산시 대학로 558
군산대학교 컴퓨터정보공학과

Copyright © www.leelab.co.kr. All rights reserved.