Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove all previous versions of python

I have some experience with C++ and Fortran, and I want to start using python for my post-processing as I am starting to realise how inefficient MATLAB is for what I need to do (mostly involves plots with millions of points).

I already had a few versions of python installed, from every time I wanted to start using. It has now become a mess. In /usr/local/bin/, here is what the command ls python* returns:

python            python2.7         python3           python3.5         python3.5m        pythonw-32
python-32         python2.7-32      python3-32        python3.5-32      python3.5m-config pythonw2.7 
python-config     python2.7-config  python3-config    python3.5-config  pythonw           pythonw2.7-32

I now want a clean slate. I want a safe way to remove all the previous versions of python, including all of their packages, so I can just install the latest version and import all the libraries I want like numpy and matplotlib smoothly (I had some issues with that).

EDIT:

I am running on OSX Yosemite 10.10.

like image 366
solalito Avatar asked Oct 09 '15 08:10

solalito


People also ask

Should I delete old versions of Python?

If you have older versions of either R , or Python , it is recommended to update them to the newest versions in order to avoid any errors. To do this, we firstly need to completely remove the currently installed versions. Go to Control Panel and select Programs and Features .

How do I uninstall Python from command line?

In the Command line, open the directory where the Python is installed, and then utilize the “del python.exe” command to remove Python from the system.


1 Answers

Do not uninstall your system's Python interpreter (Python 2.7 most probably). You might consider uninstalling the other version (Python 3.5 most probably), but I do not think you really need to do that (it may not be a bad idea to keep a system-wide Python 3 interpreter... who knows!).

If you want a clean state I would recommend you to use virtual environments for now on. You have two options:

  • Use virtualenv and pip to setup your virtual environments and packages. However, using pip means you will have to compile the packages that need compilation (numpy, matplotlib and many other scientific Python packages that you may use for your "post-processing").
  • Use Conda (or Miniconda). This way you will be able to handle virtual environments but without having to compile Python packages yourself. Conda also allows you to handle different Python interpreters without the need of having them installed in your system (it will download them for you).

Also, you say you are feeling MATLAB is inefficient for plotting millions of points. I do not know your actual needs/constraints, but I find Matplotlib to be very inefficient for plotting large data and/or real-time data.

Just as a suggestion, consider using PyQtGraph. If you still feel that is not fast enough, consider using VisPy (probably less functional/convenient at the moment, but more efficient).

like image 114
Peque Avatar answered Nov 02 '22 04:11

Peque