How to solve ValueError: bad marshal data when importing matplotlib
This error occurred when I was trying to run a .py to plot my graphs using matplotlib for the research. I was able to plot graphs well before this happened. However it wasted my precious few hours dedicated to research work so I want to spare your time and thought of writing how I solved... When I googled the error it said that it was an error in .pyc files but was not specific. I tried the given solutions like reinstalling python. (not reinstalling OS which was given as solution too since uninstalling python would cause OS errors) The method I tried to remove .pyc files -> here The error again was -> Traceback (most recent call last): File "2m.py", line 2, in <module> import matplotlib.pyplot as plt File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 123, in <module> import pyparsing ValueError: bad marshal data (string ref out of range) Then I tried installing pyparsing which was already installed. So I uni