AWS

AWS Cloud9にPython3.9をインストール


press
AWS Cloud9にPython3.9をインストール

AWS Cloud9にPython3.9をインストール

AWSのCloud9(Ubuntu)にはデフォルトでPython 3.6.9がインストールされています。

openaiに必要なpandasのインストール

openaiを利用しようとpipでインストールを試みたところ、Pandas 1.2.3以上のバージョンが必要という以下のエラーが発生しました。

Collecting pandas>=1.2.3 (from openai->-r requirements.txt (line 2))
  Could not find a version that satisfies the requirement pandas>=1.2.3 (from openai->-r requirements.txt (line 2)) (from versions: 0.1, 0.2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4, 0.24.0, 0.24.1, 0.24.2, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5)
No matching distribution found for pandas>=1.2.3 (from openai->-r requirements.txt (line 2))

Pandas 1.2.3をインストールをしようとしたところ以下のエラーが発生しました。

Collecting pandas
  Using cached https://files.pythonhosted.org/packages/c3/e2/00cacecafbab071c787019f00ad84ca3185952f6bb9bca9550ed83870d4d/pandas-1.1.5-cp36-cp36m-manylinux1_x86_64.whl
Collecting 1.2.3
  Could not find a version that satisfies the requirement 1.2.3 (from versions: )
No matching distribution found for 1.2.3

pyenvのインストールから設定

調べるとPython 3.8以上が必要らしいので、Cloud9にpyenvで3.9をインストールします。

git clone https://github.com/pyenv/pyenv.git ~/.pyenv


echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
source ~/.bashrc

上記コマンドを1行づつ実行するとpyenvが使えるようになるので、以下のコマンドを実行して使用するPythonのバージョンを指定します。

pyenv local 3.9.0

localはコマンドを実行したディレクトリのみ設定されるので、全体的にバージョンを固定したい場合はlocalglobalに変えて実行します。


株式会社ファントムへのお問い合わせ

群馬県でPythonを使ったAIやソフトウェアを開発している株式会社ファントムが運営しています。




    Related Articles

    Python

    PythonとMoviePyで動画ファイルの指定時間ごとの分割を自動化

    PythonとMoviePyで動画ファイルの指定時間ごとの分割を自動化 OpenCVなどで動画の処理を行う際に、1分毎の変化や10分毎に結果を見たいときに一連の動画から指定した時間毎に分割して切り出したいことがあります。 […]

    Posted on by press
    Django

    pipenv shellをしてもactivateできない

    pipenv shellをしてもactivateできない pipenvで作った仮想環境に出たり入ったりを繰り返していると、pipenv shellをしても以下のようにShell for UNKNOWN_VIRTUAL_E […]

    Posted on by press

    最新情報をお届けします!

    メーリングリストに登録するとファントムの最新情報をお届けします

    お客様のメールアドレスを共有することはありません