The path you're supplying in massFile
is relative to the directory you're executing the script in.
To see where you are, just type pwd
in your shell. In your case, it will return /Users/BigD/Dropbox/PhD/PPMS/
. So this value is silently prepended to your path:
massFile='/Users/BigD/Dropbox/PhD/PPMS/Users/BigD/Dropbox/PhD/PPMS/DATA/DB/HeatCap/HeatCapMass.txt'
This is also the value you're seing in your traceback.
There are two ways to fix this:
To mark a path to be absolute just prefix the path with a /
:
massFile='/Users/BigD/Dropbox/PhD/PPMS/DATA/DB/HeatCap/HeatCapMass.txt'
or to keep it relative you have to remove the unneeded bits:
massFile='DATA/DB/HeatCap/HeatCapMass.txt'
I would suggest picking the latter, that way you can move the project around without breaking all your paths.