본문으로 바로가기

파이썬 공식 홈페이지에 무설치 버전을 제공하고 있음.
(https://www.python.org/downloads/release/python-391/)

아래로 쭉 내리다면 Windows embeddable package (64-bit) 이걸 받는다.

무설치 버전의 최고의 장점은 폴더채로 들고 다니면 어디서든 사용가능한 장점이 있음.
또 다른 응용 프로그램에 포함시켜서 파이썬의 기능을 이용할수도 있고..

어쨌든.. zip 파일을 다운받아 압축을 풀면 바로 사용가능함.
근데 문제는 pip 가 없다? pip가 없으면 외부 모듈 설치가 난감함.

pip 설치는 다음과 같이..
get-pip.py 를 아래에서 다운받아 적절한 폴더에 넣어둔다.
https://bootstrap.pypa.io/get-pip.py

다음 아래와 같이 설치한다.

C:\python-3.9.0-embed-amd64>python get-pip.py
Collecting pip
  Using cached pip-20.3.3-py2.py3-none-any.whl (1.5 MB)
Collecting setuptools
  Downloading setuptools-51.3.3-py3-none-any.whl (786 kB)
     |████████████████████████████████| 786 kB 1.6 MB/s
Collecting wheel
  Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, setuptools, wheel
  WARNING: The scripts pip.exe, pip3.9.exe and pip3.exe are installed in 'C:\python-3.9.0-embed-amd64\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts easy_install-3.9.exe and easy_install.exe are installed in 'C:\python-3.9.0-embed-amd64\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script wheel.exe is installed in 'C:\python-3.9.0-embed-amd64\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.3.3 setuptools-51.3.3 wheel-0.36.2
 
C:\python-3.9.0-embed-amd64>


이제 모듈을 설치할려고하니.. 이런 에러가..

C:\python-3.9.0-embed-amd64>Scripts\pip.exe install python-pptx
Traceback (most recent call last):
  File "runpy.py", line 197, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "C:\python-3.9.0-embed-amd64\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'


파이썬 폴더에 보면 python39._pth 파일이 있는데 이 파일 마지막에 아래를 추가.

lib\site-packages


다시 설치하면

C:\python-3.9.0-embed-amd64>scripts\pip install python-pptx
Collecting python-pptx
  Downloading python-pptx-0.6.18.tar.gz (8.9 MB)
     |████████████████████████████████| 8.9 MB 6.4 MB/s
Collecting lxml>=3.1.0
  Downloading lxml-4.6.2-cp39-cp39-win_amd64.whl (3.5 MB)
     |████████████████████████████████| 3.5 MB ...
Collecting Pillow>=3.3.2
  Downloading Pillow-8.1.0-cp39-cp39-win_amd64.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB ...
Collecting XlsxWriter>=0.5.7
  Downloading XlsxWriter-1.3.7-py2.py3-none-any.whl (144 kB)
     |████████████████████████████████| 144 kB ...
Building wheels for collected packages: python-pptx
  Building wheel for python-pptx (setup.py) ... done
  Created wheel for python-pptx: filename=python_pptx-0.6.18-py3-none-any.whl size=275704 sha256=968c6fae2111efebcae960370fb4ed5ceb311d0fa762f19fc82a9994aba754b6
  Stored in directory: c:\users\ihmin\appdata\local\pip\cache\wheels\94\b7\70\0c19e32b072e500447ae9a17df9389fc046973ef1df8b0c239
Successfully built python-pptx
Installing collected packages: XlsxWriter, Pillow, lxml, python-pptx
Successfully installed Pillow-8.1.0 XlsxWriter-1.3.7 lxml-4.6.2 python-pptx-0.6.18


정상 설치됨.

'블로그 (Blog) > 개발로그 (Devlogs)' 카테고리의 다른 글

FBVector  (0) 2024.03.08
ffmpeg 프레임 추출 예제  (0) 2024.03.08
GNU utilities for Win32  (0) 2024.03.08
Bitvise SSH Server 셋팅방법  (0) 2024.03.08
PHP 에서 특정 국가만 허용하기  (0) 2024.03.08