「インストール - Python」の版間の差分

ナビゲーションに移動 検索に移動
編集の要約なし
編集の要約なし
1行目: 1行目:
== Pythonのダウンロード ==
== Pythonのダウンロード ==
[https://www.python.org/downloads/ こちらの公式サイト]から、Pythonのソースコードをダウンロードする。<br>
[https://www.python.org/downloads/ こちらの公式サイト]から、Pythonのソースコードをダウンロードする。<br>
ここでは、最新のPython3.8.4(2020/7/18 現在)の最新を導入するので、"Latest Python 3 Release - Python 3.8.4"を選択する。<br>
ここでは、最新のPython3.8.6(2020/9/30 現在)の最新を導入するので、"Latest Python 3 Release - Python 3.8.6"を選択する。<br>
または、以下のコマンドを実行してダウンロードする。<br>
または、以下のコマンドを実行してダウンロードする。<br>
  mkdir -p ~/InstallSoftware/Python/Python-3.8.4 && cd ~/Python/
  mkdir -p ~/InstallSoftware/Python/Python-3_8_6
  wget https://www.python.org/ftp/python/3.8.4/Python-3.8.4.tar.xz
  wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz
<br><br>
<br><br>


19行目: 19行目:
ここでは、Pythonをホームディレクトリにインストールする。<br>
ここでは、Pythonをホームディレクトリにインストールする。<br>
<br>
<br>
# ダウンロードしたファイルを解凍するため、以下のコマンドを実行する。<br><code>tar xvf Python-3.8.4.tar.xz</code>
# ダウンロードしたファイルを解凍するため、以下のコマンドを実行する。
# 次に、解凍したディレクトリに移動して、Makeファイルを作成する。<br><code>./configure --enable-optimizations --prefix=/home/ユーザ名/InstallSoftware/Python/Python-3_8_4</code>
#: <code>tar xvf Python-3.8.6.tar.xz</code>
# Pythonのソースコードのコンパイルを行う。(-j5はジョブ数を増加させて高速処理を行っている)<br><code>make -j 8</code>
# 解凍したディレクトリに移動して、コンパイル用のディレクトリを作成する。
# コンパイル完了後、インストールを行う。<br><code>make altinstall</code>
#: <code>cd Python-3.8.6 && mkdir build</code>
# 以下のディレクトリにシンボリックリンクを作成する。<br><code>ln -s ~/InstallSoftware/Python/Python-3_8_4/lib64/python3.8/lib-dynload/ ~/InstallSoftware/Python/Python-3_8_4/lib/python3.8/</code>
# 次に、Makefileを生成するため、以下のコマンドを実行する。
# .profileファイルまたは.bashrcファイルに、以下のように環境パスを追記する。<br><code>export PATH="$HOME/InstallSoftware/Python/Python-3_8_4/bin:$PATH"</code>
#: <code>../configure --enable-optimizations --prefix=/home/ユーザ名/InstallSoftware/Python/Python-3_8_6</code>
# Pythonのソースコードのコンパイルを行う。(<code>-j 5</code>オプションを使用することで、ジョブ数を増加させて高速処理を行う)
#: <code>make -j 8</code>
# コンパイル完了後、インストールを行う。
#: <code>make altinstall</code>
# 以下のディレクトリにシンボリックリンクを作成する。
#: <code>ln -s ~/InstallSoftware/Python/Python-3_8_6/lib64/python3.8/lib-dynload/ ~/InstallSoftware/Python/Python-3_8_6/lib/python3.8/</code>
# .profileファイルまたは.bashrcファイルに、以下のような環境変数パスを追記する。
#: <code>export PATH="$HOME/InstallSoftware/Python/Python-3_8_6/bin:$PATH"</code>
<br><br>
<br><br>


案内メニュー