最終更新:2022-09-26 (月) 15:27:43 (577d)
Ubuntu/Python
Ubuntu/パッケージ
- python3-all: package depending on all supported Python 3 runtime versions
Ubuntu 20.04
- python2 - Python 2.7.17
- python3 - Python 3.8.2
python-is-python3
- symlinks /usr/bin/python to python3
メモ
- pythonを入れようとするとpython-is-python2がselectされる
user@vm:~$ sudo apt install python --dry-run [sudo] password for user: Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'python-is-python2' instead of 'python'
Ubuntu 18.04
- python - Python 2.7.15
- python3 - Python 3.6
パッケージ名 Python 3.8 python3.8 Python 3.7 python3.7? Python 3.6 python3.6?/python3 デフォルト
- Linux/usr/bin/python3 -> python3.6?
切り替え
ターミナルが開かなくなる
- https://github.com/aben20807/blog-post/issues/80
- https://web.archive.org/web/20210506180938/https://github.com/aben20807/blog-post/issues/80
$ gnome-terminal Traceback (most recent call last): File "/usr/bin/gnome-terminal", line 9, in <module> from gi.repository import GLib, Gio File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module> from . import _gi ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)
cd /usr/lib/python3/dist-packages/gi sudo ln -s _gi.cpython-{36m,37m}-x86_64-linux-gnu.so
- Python 3.8のときは38っぽいけどなんにせよpython3を切り替えると影響がでかいのでオススメしない