Reinstalling Python on Ubuntu 14.04

Asked

Viewed 416 times

2

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

I did the installation of Python 3, but I already had Python 2 installed in my computer and I thought I would need to delete Python 2 or at least replace.

Looking on the internet I saw some commands about it and ran some until I found a tutorial and when I ran the listed commands I ended up deleting python.

When I was turning on my pc there was no toolbar and I couldn’t open anything! After several attempts with Recovery mode I managed to enter again.

But now when I try to run on the 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 wonder how I can reinstall python

  • No need to uninstall python2 they run parallel without any problems, this is poorly played

  • And is there any way to fix ? @Miguel

  • Try to do sudo apt-get udpate, and then follow http://askubuntu.com/questions/101591/how-do-i-install-python-2-7-2-on-ubuntu or https://gist.github.com/lukandgren/2659457 or http://docs.python-guide.org/en/latest/starting/linux/. You have several things about this: https://www.google.pt/search?client=ubuntu&channel=fs&q=reinstall+python2.7&ie=utf-8&oe=utf-8&gfe_rd=cr&ei=9ITFV7z1Icjv8Aee46SAAw

1 answer

1

Well, at this point, it’s more likely that you need to re-install your Ubuntu.

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

Automatic package management still uninstalled all qeu packages depend on Python2 - so your system is actually broken.

Linux is made in a way that is not only possible, as it is common to have Python2 and Python3 installed side by side - but, even more, it is common that each project you go to do can have its own copy of Python, so that it does not conflict with the dependencies of the system itself. This can be either a copy compiled by yourself from source, or a "virtual" copy with the use of Virtualenv. Using virtualenv, for example, prevents that if you need any Python package in a version other than the one provided by the system (for example, a newer version of scrapy), you can install it in isolation. Usually smaller packages don’t break both the system and boot Python 2 into the raw case, but can still break several things.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.