I am able to generate *.dat file:
vikas@server:~/memory_profiler-0.36$ ./mprof run --python test_sl.py
vikas@server:~/memory_profiler-0.36$ ls *.dat
mprofil
I had the same problem. I used memory_profiler lib typing this commands
(mprof run runner.py and mprof plot) and got a message "matplotlib is needed for plotting"
I tried to get rid of this problem following advice I found here but in the result I solved this problem completing these simple steps:
delete files in /usr/lib64/python2.7/site-packages/ connected with matplotlib (or you can uninstall matplotlib using the ordinary way)
use sudo yum-builddep python-matplotlib to install connected packages (222 packages were installed, if you need apt-get, you need this command: sudo apt-get build-dep python-matplotlib)
install matplotlib sudo yum reinstall python-matplotlib (or use install command, with apt-get: sudo apt-get install python-matplotlib)
I believe this will help.