今天我试图添加一个存储库时,我发现了一个似乎无法解决的奇怪错误。
我正试着执行这个命令
sudo apt-add-repository ppa:fish-shell/release-3当它总是返回以下错误消息时
Traceback (most recent call last):
File "/usr/bin/apt-add-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 67, in <module>
from gi.repository import Gio
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)我试着用这个命令来诊断它
sudo update-alternatives --config python3它显示了这一点
There is only one alternative in link group python3 (providing /usr/bin/python3): /usr/bin/python3.8
Nothing to configure.我还尝试访问/usr/lib/python3/dist-package/gi,并使用以下命令在其中添加一个符号链接
sudo ln -s _gi.cpython-{36m,37m}-x86_64-linux-gnu.so但它还是不起作用
我尝试将正确的python版本添加到/usr/bin/apt-add-repository中
我也尝试过使用
python3 -m pip install gi
Could not find a version that satisfies the requirement gi (from versions: )
No matching distribution found for gi我如何修复这个恼人的错误?
发布于 2021-01-23 01:57:23
完成:
sudo apt-get install graphviz和代码:
import objgraph
import random
import io
from graphviz import Source
from io import StringIO
q = StringIO()
#objgraph.show_refs([SAFE_TAGS], output=s)
objgraph.show_chain(
objgraph.find_backref_chain(
random.choice(objgraph.by_type('dict')),
objgraph.is_proper_module),
output=q)
q.seek(0)
Source(q.read())https://stackoverflow.com/questions/63223959
复制相似问题