뽁
PYTHON PIP 설치 본문
requests 모듈이 없다는 얘기이다.
requests 모듈을 설치하기 위해 PIP 를 먼저 설치해야 한다.
PIP 설치 후 request, bs4 모듈 설치까지 하겠다.
bs4는 HTML, CSS, JavaScript 등 웹언어를 기반으로 하고 있는데, 이를 사람이 보기 좋게 가독성을 높여줄 수 있는 모듈인 BeautifulSoup 임.
1. PIP 설치
1) 아래 URL로 접속
https://bootstrap.pypa.io/get-pip.py
2) 무지하게 긴 소스가 나온다. 이를 전체 복사하여 자신의 PC에 저장한다.
get-pip.py
3) 도스 창을 열고 위 파일을 실행한다.
C:\Python33>python get-pip.py Collecting pip Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB) 100% |################################| 1.3MB 348kB/s Collecting setuptools Downloading setuptools-34.1.1-py2.py3-none-any.whl (389kB) 100% |################################| 399kB 890kB/s Collecting wheel Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB) 100% |################################| 71kB 2.0MB/s Collecting appdirs>=1.4.0 (from setuptools) Downloading appdirs-1.4.0-py2.py3-none-any.whl Collecting packaging>=16.8 (from setuptools) Downloading packaging-16.8-py2.py3-none-any.whl Collecting six>=1.6.0 (from setuptools) Downloading six-1.10.0-py2.py3-none-any.whl Collecting pyparsing (from packaging>=16.8->setuptools) Downloading pyparsing-2.1.10-py2.py3-none-any.whl (56kB) 100% |################################| 61kB 1.9MB/s Installing collected packages: pip, appdirs, six, pyparsing, packaging, setuptoo ls, wheel Successfully installed appdirs-1.4.0 packaging-16.8 pip-9.0.1 pyparsing-2.1.10 s etuptools-34.1.1 six-1.10.0 wheel-0.29.0 |
4) Python 루트 밑에 Scripts 폴더로 이동하여 아래 명령어 실행
C:\Python33>cd Scripts C:\Python33\Scripts>dir C 드라이브의 볼륨에는 이름이 없습니다. 볼륨 일련 번호: B43A-2416 C:\Python33\Scripts 디렉터리 2017-02-10 오후 06:21 <DIR> . 2017-02-10 오후 06:21 <DIR> .. 2017-02-10 오후 06:21 98,153 easy_install-3.3.exe 2017-02-10 오후 06:21 98,153 easy_install.exe 2017-02-10 오후 06:21 98,125 pip.exe 2017-02-10 오후 06:21 98,125 pip3.3.exe 2017-02-10 오후 06:21 98,125 pip3.exe 2017-02-10 오후 06:21 98,132 wheel.exe 6개 파일 588,813 바이트 2개 디렉터리 177,196,744,704 바이트 남음 C:\Python33\Scripts>pip install requests Collecting requests Downloading requests-2.13.0-py2.py3-none-any.whl (584kB) 100% |################################| 593kB 721kB/s Installing collected packages: requests Successfully installed requests-2.13.0 |
5) bs4 설치
pip를 설치했으니 필요한 모듈을 모두 불러와서 설치하자~~
C:\Python33\Scripts>pip install bs4 Collecting bs4 Downloading bs4-0.0.1.tar.gz Collecting beautifulsoup4 (from bs4) Downloading beautifulsoup4-4.5.3-py3-none-any.whl (85kB) 100% |################################| 92kB 822kB/s Building wheels for collected packages: bs4 Running setup.py bdist_wheel for bs4 ... done Stored in directory: C:\Users\cj\AppData\Local\pip\Cache\wheels\84\67\d4\9e09d 9d5adede2ee1c7b7e8775ba3fbb04d07c4f946f0e4f11 Successfully built bs4 Installing collected packages: beautifulsoup4, bs4 Successfully installed beautifulsoup4-4.5.3 bs4-0.0.1 |
'IT Cafe+ > Python' 카테고리의 다른 글
[PYTHON] 좋은 자료 URL - 예제 (0) | 2017.02.13 |
---|---|
[PYTHON] crawler 개발 (0) | 2017.02.10 |
[PYTHON]python을 ultraedit에서 실행하기위한 설정 (0) | 2017.02.09 |