Python for windows (Python3) パッケージのインストール (Python3.7 for Windows)
Table of Contents
概要
基本的には pip パッケージ名を指定するだけでインストールできる。
できない場合は Unofficial Windows Binaries for Python Extension Packages より、ダウンロードしてインストール。
事例
Pygments のインストール
>pip install Pygments Collecting Pygments Using cached Pygments-2.1.3-py2.py3-none-any.whl Installing collected packages: Pygments Successfully installed Pygments-2.1.3
pyinstaller のインストール
>pip install pyinstaller Collecting pyinstaller Downloading https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz (3.5MB) 100% |********************************| 3.5MB 5.2MB/s Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Collecting pefile>=2017.8.1 (from pyinstaller) Downloading https://files.pythonhosted.org/packages/36/58/acf7f35859d541985f0a6ea3c34baaefbfaee23642cf11e85fe36453ae77/pefile-2019.4.18.tar.gz (62kB) 100% |********************************| 71kB 8.2MB/s Collecting macholib>=1.8 (from pyinstaller) Downloading https://files.pythonhosted.org/packages/41/f1/6d23e1c79d68e41eb592338d90a33af813f98f2b04458aaf0b86908da2d8/macholib-1.11-py2.py3-none-any.whl Collecting altgraph (from pyinstaller) Downloading https://files.pythonhosted.org/packages/0a/cc/646187eac4b797069e2e6b736f14cdef85dbe405c9bfc7803ef36e4f62ef/altgraph-0.16.1-py2.py3-none-any.whl Collecting pywin32-ctypes (from pyinstaller) Downloading https://files.pythonhosted.org/packages/9e/4b/3ab2720f1fa4b4bc924ef1932b842edf10007e4547ea8157b0b9fc78599a/pywin32_ctypes-0.2.0-py2.py3-none-any.whl Requirement already satisfied: setuptools in c:\usr\python37\lib\site-packages (from pyinstaller) (40.8.0) Collecting future (from pefile>=2017.8.1->pyinstaller) Downloading https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB) 100% |********************************| 829kB 8.6MB/s Building wheels for collected packages: pyinstaller Building wheel for pyinstaller (PEP 517) ... done Stored in directory: C:\Users\wurly\AppData\Local\pip\Cache\wheels\09\ee\0a\94ef5d39074625f49e2e9cf97ac30cb7a87e1a7458ed195b8d Successfully built pyinstaller Installing collected packages: future, pefile, altgraph, macholib, pywin32-ctypes, pyinstaller Running setup.py install for future ... done Running setup.py install for pefile ... done Successfully installed altgraph-0.16.1 future-0.17.1 macholib-1.11 pefile-2019.4.18 pyinstaller-3.4 pywin32-ctypes-0.2.0
numpy のインストール
> pip install numpy Collecting numpy Downloading https://files.pythonhosted.org/packages/ce/61/be72eee50f042db3acf0b1fb86650ad36d6c0d9be9fc29f8505d3b9d6baa/numpy-1.16.4-cp37-cp37m-win_amd64.whl (11.9MB) |********************************| 11.9MB ... Installing collected packages: numpy Successfully installed numpy-1.16.4
matplotlib のインストール
>pip install matplotlib Collecting matplotlib Downloading https://files.pythonhosted.org/packages/3b/52/17dbb82ca36937dd4d0027fe1945c3c78bdb465b4736903d0904b7f595ad/matplotlib-3.1.0-cp37-cp37m-win_amd64.whl (9.1MB) |********************************| 9.1MB ... Collecting kiwisolver>=1.0.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/c6/ea/e5474014a13ab2dcb5056608e0716c600c3d8a8bcffb10ed55ccd6a42eb0/kiwisolver-1.1.0-cp37-none-win_amd64.whl (57kB) |********************************| 61kB 3.8MB/s Requirement already satisfied: numpy>=1.11 in c:\usr\python37\lib\site-packages (from matplotlib) (1.16.4) Collecting cycler>=0.10 (from matplotlib) Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl Collecting python-dateutil>=2.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB) |********************************| 235kB 6.8MB/s Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/dd/d9/3ec19e966301a6e25769976999bd7bbe552016f0d32b577dc9d63d2e0c49/pyparsing-2.4.0-py2.py3-none-any.whl (62kB) |********************************| 71kB ... Requirement already satisfied: setuptools in c:\usr\python37\lib\site-packages (from kiwisolver>=1.0.1->matplotlib) (40.8.0) Collecting six (from cycler>=0.10->matplotlib) Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl Installing collected packages: kiwisolver, six, cycler, python-dateutil, pyparsing, matplotlib Successfully installed cycler-0.10.0 kiwisolver-1.1.0 matplotlib-3.1.0 pyparsing-2.4.0 python-dateutil-2.8.0 six-1.12.0
PyQt4 のインストール
Unofficial Windows Binaries for Python Extension Packages より、ダウンロード。
pip install PyQt4-4.11.4-cp37-cp37m-win_amd64.whl
D:\download\win\Python\3.7>pip install PyQt4-4.11.4-cp37-cp37m-win_amd64.whl Processing d:\download\win\python\3.7\pyqt4-4.11.4-cp37-cp37m-win_amd64.whl Installing collected packages: PyQt4 Successfully installed PyQt4-4.11.4
PyQt5 のインストール
>pip install PyQt5 Collecting PyQt5 Downloading https://files.pythonhosted.org/packages/f4/2c/d59dc21d5464f4bef3d58a1a1670a58ed14989f4642f6cf4ef8b7043c423/PyQt5-5.12.2-5.12.3-cp35.cp36.cp37.cp38-none-win_amd64.whl (47.5MB) |********************************| 47.6MB 6.8MB/s Collecting PyQt5_sip<13,>=4.19.14 (from PyQt5) Downloading https://files.pythonhosted.org/packages/76/05/a65bb95c1f5a9f4a7dcbecbd0a8f8c4b9a9231aa40f600cde4a00635b5d4/PyQt5_sip-4.19.17-cp37-none-win_amd64.whl (51kB) |********************************| 61kB ... Installing collected packages: PyQt5-sip, PyQt5 Successfully installed PyQt5-5.12.2 PyQt5-sip-4.19.17