GoogleColabでPythonのバージョン切り替えができない
解決したいこと
GoogleColabでPythonのバージョン切り替えができない/クラッシュする
背景
StyleGAN2-ADAの実験をしています
https://github.com/NVlabs/stylegan2-ada-pytorch
互換性の関係でRequirementsに記載のある環境にしたく思い色々試しています.
発生している問題・エラー
(実行したもの)
sudo apt install python3.9
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
!python --version
結果
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libpython3.9-minimal libpython3.9-stdlib python3.9-minimal
Suggested packages:
python3.9-venv binfmt-support
The following NEW packages will be installed:
libpython3.9-minimal libpython3.9-stdlib python3.9 python3.9-minimal
0 upgraded, 4 newly installed, 0 to remove and 49 not upgraded.
Need to get 4,846 kB of archives.
After this operation, 18.9 MB of additional disk space will be used.
Get:1 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 libpython3.9-minimal amd64 3.9.21-1+jammy1 [837 kB]
Get:2 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 python3.9-minimal amd64 3.9.21-1+jammy1 [2,075 kB]
Get:3 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 libpython3.9-stdlib amd64 3.9.21-1+jammy1 [1,841 kB]
Get:4 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 python3.9 amd64 3.9.21-1+jammy1 [93.0 kB]
Fetched 4,846 kB in 2s (2,013 kB/s)
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78, <> line 4.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Selecting previously unselected package libpython3.9-minimal:amd64.
(Reading database ... 124574 files and directories currently installed.)
Preparing to unpack .../libpython3.9-minimal_3.9.21-1+jammy1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.21-1+jammy1) ...
Selecting previously unselected package python3.9-minimal.
Preparing to unpack .../python3.9-minimal_3.9.21-1+jammy1_amd64.deb ...
Unpacking python3.9-minimal (3.9.21-1+jammy1) ...
Selecting previously unselected package libpython3.9-stdlib:amd64.
Preparing to unpack .../libpython3.9-stdlib_3.9.21-1+jammy1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.21-1+jammy1) ...
Selecting previously unselected package python3.9.
Preparing to unpack .../python3.9_3.9.21-1+jammy1_amd64.deb ...
Unpacking python3.9 (3.9.21-1+jammy1) ...
Setting up libpython3.9-minimal:amd64 (3.9.21-1+jammy1) ...
Setting up python3.9-minimal (3.9.21-1+jammy1) ...
Setting up libpython3.9-stdlib:amd64 (3.9.21-1+jammy1) ...
Setting up python3.9 (3.9.21-1+jammy1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for man-db (2.10.2-1) ...
Python 3.11.11
自分で試したこと
ここら辺の記事全て試しました