The default python version was 2.7.12 in ubuntu. I installed python2.7.13 using the below commands.
Then download using the following command:
version=2.7.13
cd ~/Downloads/
wget https://www.python.org/ftp/python/$version/Python-$version.tgz
Extract and go to the directory:
tar -xvf Python-$version.tgz
cd Python-$version
Now, install using the command you just tried, using checkinstall instead to make it easier to uninstall if needed:
./configure
sudo make install
Now there is some issue in pandas(giving no module named pandas when I try to import but if we try to install it shows required already satisfied) so I want to completely remove python 2.7.13 and reinstall python 2.7.12. How can I achieve this?
Find and click the “Environment Variables” button. Highlight the “Path” variable in the system variable section by left-clicking it. Then press the “Edit” button. If you see a path of the Python bin folder in the menu, remove it by selecting it and pressing the “Delete” button on the right side of the menu.
My python was corrupted due to some module. So I planned to re-installed or remove the python completely from my Ubuntu 16.04 machine. But sudo apt-get install --reinstall python2.7
command was also failing and was throwing same error. So I finally Did few hacks and cracks. Here are the steps -
- sudo rm -rf /usr/bin/python2.x as well as python3.x
- sudo rm -rf /usr/lib/python2.x as well as python3.x
- sudo rm -rf /usr/local/lib/python2.x as well as python 3.x
Updating Ubuntu
- sudo apt-get update
In Between if you get this error The package needs to be reinstalled ubuntu Then Run following command
sudo vi /var/lib/dpkg/status
And delete all the lines from above file for the package which was expecting re-install and run sudo apt-get update
again.
Now download a python tgz file from https://www.python.org/downloads/ and unzip it and CD into it
./configure
make test
sudo make install
Python should be installed now. Check by running python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With