Python reinstallation in Ubuntu 14.04

0

I'm new to linux and trying to make an example using Scrapy.

I did the installation of Python 3, but I already had Python 2 installed on my machine and I thought I would have to delete Python 2 or at least replace it.

Looking at the internet I saw some commands about this and I ran some until I found a tutorial and when I ran the listed commands I ended up excluding python.

When I turned on my PC there was no toolbar and I could not open anything! After several attempts with recovery mode I was able to log in again.

But now when I try to run in terminal sudo apt-get install this error appears: E: The package python-apt needs to be reinstalled, but I can't find an archive for it

I would like to know how to reinstall python

    
asked by anonymous 30.08.2016 / 14:58

1 answer

0

Well, at this point, you're more likely to need to re-install your ubuntu.

Python2 is an integral part of a modern Linux system (not just Ubuntu), and, as you realize, the system can not work without it.

Automatic package management has still uninstalled all packages that depend on Python2 - so your system is really broken.

Linux is done in a way that is not only possible, as it is common to have Python2 and Python3 installed side by side - but even more so, it is common that every project you go to can have its own copy of Python, so that it does not conflict with the dependencies of the system itself. This can either be a copy compiled by yourself from the source code, or a "virtual" copy using Virtualenv. Using virtualenv, for example, prevents you from installing any other Python package in a different version from the one made available by the system (for example, a newer version of scrapy), so you can install it in isolation. In general smaller packages do not break both the system and boot Python 2 in the raw fleet, but can still leave a number of things broken.

    
31.08.2016 / 11:20