Pop!_OS に Python をインストールすると、壊れた (?) Python のインストールにより lsb_release がクラッシュします。

Pop!_OS に Python をインストールすると、壊れた (?) Python のインストールにより lsb_release がクラッシュします。

Pop!_OS 20.04(Ubuntuベース)でPythonのインストールを台無しにしました。何をしたのかよく分からない。オンラインで読んだことによると、多くの問題が実行不可能に由来しているようですlsb_release -a

  File "/usr/bin/lsb_release", line 25, in <module>
    import lsb_release
ModuleNotFoundError: No module named 'lsb_release'

解決策があるここsite-packagesこのフォーラムではフォルダが見つからないようです。

jhonig@computer:~$ ls /usr/local/lib/python*
/usr/local/lib/python2.7:
dist-packages  site-packages

/usr/local/lib/python3.7:
dist-packages

/usr/local/lib/python3.8:
dist-packages

また、Python 3.5をインストールしてlsb_releaseを実行してみましたが、サイコロはありませんでした。

jhonig@computer:~$ python3.5 /usr/bin/lsb_release
Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 25, in <module>
    import lsb_release
ImportError: No module named 'lsb_release'
jhonig@computer:~$

デバッグに役立つ追加情報は次のとおりです。

pipを使用して何かをインストールしようとすると、次のエラーに関するメッセージが表示されます。

jhonig@computer:~$ pip3 install flask
Defaulting to user installation because normal site-packages is not writeable
[Further lines redacted for brevity, but Python is complaining that lsb_release returned non-zero exit status 1]

ここ私がインストールしたすべてのPythonパッケージのリストです。バージョンの競合が原因で問題が発生しているようですが、すでにpython2.7を削除してシステムをブロックしているので、どこから始めるべきかわかりません(はい、わかりました、愚かなことです)。

また、GNOME端末などの特定のアプリケーションを実行することはできません。

jhonig@computer:~$ gnome-terminal
Traceback (most recent call last):
  File "/usr/bin/gnome-terminal", line 9, in <module>
    from gi.repository import GLib, Gio
ModuleNotFoundError: No module named 'gi'
jhonig@computer:~$

役に立つかもしれない追加情報:

jhonig@computer:~$ type -a python3
python3 is /usr/bin/python3
python3 is /bin/python3
jhonig@computer:~$ python3 --version
Python 3.7.9
jhonig@computer:~$ type -a python
python is /usr/bin/python
python is /bin/python
jhonig@computer:~$ python --version
Python 2.7.18rc1
jhonig@computer:~$ which python3
/usr/bin/python3
jhonig@computer:~$ which python
/usr/bin/python
jhonig@computer:~$ ls -lah /usr/bin/python3
lrwxrwxrwx 1 root root 18 Oct  1 14:01 /usr/bin/python3 -> /usr/bin/python3.7
jhonig@computer:~$ ls -lah /usr/bin/python
lrwxrwxrwx 1 root root 24 Oct  2 10:52 /usr/bin/python -> /etc/alternatives/python
jhonig@computer:~$ ls -lah /etc/alternatives/python 
lrwxrwxrwx 1 root root 18 Oct  2 10:55 /etc/alternatives/python -> /usr/bin/python2.7

今回も lsb_release の問題が解決すれば、この問題も解決されると思いますが、よくわかりません。

よろしくお願いします! ! !

ベストアンサー1

おすすめ記事