Windows で,Python をソースコードからビルドして,インストールする.
Python のインストール: 別ページ »で説明は,複数の方法がある.
【関連する外部ページ】 https://devguide.python.org/setup/#getting-the-source-code
Windows での Python のインストール: 別ページ »で説明: 別ページ »で説明(あとのトラブルが起きにくいような手順を定めている)
Python の公式ページ: https://www.python.org/
Windows での Git, cmake のインストール手順: 別ページ »で説明している.
Git の URL: https://git-scm.com/
CMake の公式ダウンロードページ: https://cmake.org/download/
Windows でのマイクロソフト Visual Studio Community ・C++ によるデスクトップ開発のインストール: 別ページ »で説明している.
起動は,Windows のメニューで「Visual Studio 20..」の下の「x64 Native Tools コマンドプロンプト (x64 Native Tools Command Prompt)」を選ぶ.「x64」は,64ビット版の意味である.
「x64 Native Tools コマンドプロンプト (x64 Native Tools Command Prompt)」がないとき:
C++ ビルドツール (Build Tools) のインストールを行うことで, 「x64 Native Tools コマンドプロンプト (x64 Native Tools Command Prompt)」がインストールされる.その手順は,別ページ »で説明
mkdir c:\tools rmdir /s /q cpython
cd c:\ git clone https://github.com/python/cpython.git
c:\cpython\PCbuild\pythoncore.vcxproj を開く(右クリックメニューが便利).すると Visual Studio が起動する.
ソリューションを右クリック.右クリックメニューで「ソリューションの再ターゲット」を選ぶ.
※ このとき作業ディレクトリ内に bzip, sqlite3, xz, zlib, libffi, openssl-bin, tcltk が自動でダウンロードが始まる
cd c:\ cd cpython .\PCbuild\build.bat
c:\cpython\PCbuild\amd64\python.exe
「exit()」で終わる
pip を使うときは,「c:\cpython\PCbuild\win32\python.exe -m pip」のように使う
curl -O https://bootstrap.pypa.io/get-pip.py c:\cpython\PCbuild\amd64\python.exe get-pip.py