So I decided that I'd go ahead and build the whole SciPy stack from source. Why? I dunno, I guess I was feeling like my life wasn't quite complicated enough.
1. The Endless Trail of Building
You might think you have to start here at NumPy. You're wrong. Wrong. Wrong. Wrong.
If you started there, you'd notice this pretty chunk
Which informs you that you should have started two weeks ago if you wanted to get down to business today. No problem, you think. I'll just go here and install ATLAS because that's the first step.
NO. WRONG AGAIN. When you go there, it lets you know very nicely that you must first install LAPACK. Okay, LAPACK. So I'll just go to the LAPACK website and start there. And then when you get that source code it tells you you need NumPy, so you're stuck in an endless loop.
Nah, just kidding. But I'll stop there and say just in case someone wants to know the most effective route for installations in Ubuntu 14.04 LTS (assuming you start in the same state of unpreparedness as I did), it's this:
2. The Approximately-Correct Order of Installations
- sudo apt-get install build-essential
- sudo apt-get install doxygen (you'll need it for the LAPACK manual)
- Grab the latest version of LAPACK
- Make the manpages.(I want to make a joke about sexism here, but I can't quite bring myself to do it.)
- Follow the LAPACK instructions like a good little English-reader. This guy has helpful instructions if you're waylayed
- Don't forget to also build the BLAS like I did.
- Test the stuff. Unless you're Orpheus or something.
- Go back to Atlas
- Pretend to read through their 400 super-important pages. (I went through them all and the only flag I could determine that I should set was -b 64. YMMV.)
- Configure as stated: cd BLDdir ; SRCdir/configure [flags]
- "make build" in the build directory you made.
- Go make coffee or something because you'll be here for a bit.
- "make check"
- "make ptcheck"
- This totally unnecessary step where bigger is better
- Hey look now we're back at NumPy!
- Aaaaand we're done with NumPy. If anyone can tell me how to build it so that it works with Python 3.3, I'd love to hear it.
3. The $PYTHONPATH to Understanding
So I ran into a problem while trying to get numpy to work with Python 3. Somewhere along the line, I definitely made my $PYTHONPATH completely unusable because while I thought I was overwriting it, I was in fact only adding new paths to horrible, unspeakable areas.
In case you got here from Googling the following error:
ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there.
And you're thinking to yourself after having visited a few websites that people are jerks and of course you can read what it's saying, but you know that you're not in the source directory because you're in your home directory. Well the answer, my friend, is that you probably did something terrible to $PYTHONPATH and you need this:
env | grep PYTHONPATH
export PYTHONPATH=[Path, no brackets obv]
Danielle has her Msc in Methodology and Statistics and works mainly in R to bring order to chaos.