$ etcdctl
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 28, in <module>
from CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module>
from CommandNotFound.db.db import SqliteDatabase
File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'.
etcdctl이 작동하는지 확인하려고합니다. 나는 또한 이것을 시도했습니다 :https://stackoverflow.com/questions/41986507/unable-to-set-default-python-version-to-python3-in-ubuntu#:~:text=Type%20alias%20python%3Dpython3%20on,your%20alias %20해야%20%20영구적.
답변1
다음 답변에 따르면:
- https://stackoverflow.com/questions/69949591/modulenotfounderror-no-module-named-apt-pkg-installing-deadsnakes-repository
- https://stackoverflow.com/questions/13708180/python-dev-installation-error-importerror-no-module-named-apt-pkg
다음을 시도했는데 작동하는 것 같습니다.
- 관련 파일을 찾으려면 다음 명령을 사용하십시오
apt_pkg
.ls /usr/lib/python3/dist-packages/*apt_pkg*
- 필요한 심볼릭 링크를 만듭니다. 내 경우에는 다음과 같았습니다.
sudo ln -s /usr/lib/python3/dist-packages/apt_pkg.cpython-38-x86_64-linux-gnu.so apt_pkg.so