Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
some errors on my terminal
#1
Hello,
i installed python 3.6 on my ubuntu via this guide

everything seems to wor, but i'm still learning python so i didn't use everything yet, but i get some errors on my terminal from the first command i type, here are the errors :

Quote:Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, inapport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23,in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

can someone explain me how can i fix this ?

Thank you.
Reply
#2
There can be some problem with this ppa ppa:jonathonf/python-3.6
@barry A. Warsaw answer.
Possible fix

The best and safest way to manage and install version is to use pyenv.
I have a tutorial here 
Example if i want 3.6.2,see it ftp to python.org and not a random ppa.
mint@mint ~ $ pyenv install 3.6.2
Downloading Python-3.6.2.tar.xz...
-> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
Installing Python-3.6.2...
Installed Python-3.6.2 to /home/mint/.pyenv/versions/3.6.2

# Make it default version
mint@mint ~ $ pyenv global 3.6.2
# Test
mint@mint ~ $ python
Python 3.6.2 (default, Aug  6 2017, 12:55:04) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020