some errors on my terminal - greed13 - Sep-21-2017
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.
RE: some errors on my terminal - snippsat - Sep-21-2017
There can be some problem with this ppa ppa:jonathonf/python-3.6
@barry A. Warsaw answer.
Quote:Please understand that installing Python 3.6 from a random PPA does not provide full support for this version of the interpreter. Python 3.6 is not yet a supported version in any version of Ubuntu (which I'm assuming your using), although we are working on it for 17.04.
Very often, you can install a new Python 3 interpreter package and many things will work because the Ubuntu infrastructure shares pure-Python modules across all installed Python 3's. Technically speaking, they will all have /usr/lib/python3/dist-packages on their sys.path so any third party pure-Python module built for a support version of Python 3 will be importable by any (package-built) installed version of Python 3.
But that 1) is a long way from saying that those third-party modules will work; 2) does not include any packages containing C extension modules, which must be rebuilt for the specific interpreter version.
Supporting a new version of Python is a long process, for which we are just starting. Please engage with [email protected] for details.
Ubuntu does install a standard exception handler so that when Python applications and such crash, we can gather crash statistics, so that we can devote resources to fixing common problems and regressions. apport (which you see in the traceback) is that crash reporting infrastructure. apport calls apt_pkg, which is an (C++) extension module and thus won't have been built for the version of Python 3.6 you installed from that PPA, unless of course the PPA owner (who I don't know) has also done an archive-wide Python 3 rebuild. Since I'm in the process of setting that up, and I know it's quite a bit of work, I doubt that's been done for this rather random PPA.
The ubuntu-devel mailing list is a better place to discuss the ongoing work to bring Python 3.6 as a supported version on Ubuntu. 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.
>>>
|