Wednesday, March 27, 2013

Installing Holopy

With the dependencies in place, I should have no trouble installing HoloPy from Launchpad right? I'll try.

I want to put HoloPy in /code/dhm/dev2:
bzr branch lp:holopy dev2

I get all kinds of bad messages about public key and stuff. But, I remember that launchpad has really good directions for setting that up.
https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair

Ok, now the branching with bazaar worked (bzr stands for bazaar).


bzr branch lp:holopy dev2
Branched 406 revisions.

Dependencies: check
Code: check
Installed?

python setup.py build_ext --inplace

It worked!!!!! From ipython, I ran the simple example from here:
http://manoharan.seas.harvard.edu/holopy/users/calc_tutorial.html#calc-tutorial
and it calculated a hologram and displayed it!

Tuesday, March 26, 2013

Dependencies, Holopy

Ok, so the software I most want to be comfortable with installing is Holopy. It is the software that my research lab wrote and maintains--- I'm a coauthor, but I still struggle with installation. So frustrating. The software is hosted on launchpad:

https://launchpad.net/holopy

And there is a manual here:

http://manoharan.seas.harvard.edu/holopy/

So, what do I need?
Python 2.7
numpy
scipy
PyYAML (3.10 is the current release)
ipython (0.13.1 is the current stable release)
matplotlib (1.2.1 is the current stable release)
mayavi2 (4.2.0 is the latest)

What do I have?
python --version
Python 2.7.3
good

python
import numpy
numpy.version.version
'1.6.1'
ok, but I'd rather have 1.7 for the enhanced polyfit that allows weights
1.7 is listed as a stable release, so I will try to update to that

python
import scipy
ImportError: No module named scipy

First, trying the line recommended from the manual:
sudo apt-get install python-scipy ipython python-matplotlib python-yaml mayavi2

Great, this fixed the scipy problem
python
import scipy
scipy.version.version
'0.9.0'
0.11 is the most recent stable version, but I think 0.9.0 should be fine

What about PyYAML?
python
import yaml
yaml .__version__
'3.10'
Great.

What about ipython?
ipython
returns IPython 0.12.1 along with some warnings about my configuration file. I should look into this sometime. This is an ok version to use I think.

What about matplotlib?
ipython
import matplotlib
matplotlib .__version__
'1.1.1rc'
Hm. This is a couple versions out of date. I should think about updating this.

What about mayavi?
ipython
import mayavi
mayavi .__version__
'4.0.0'
Hm. IS that good or not? Is that Mayavi or Mayavi2?
pip search mayavi
mayavi INSTALLED: 4.0.0
LATEST: 4.2.0
Ok... but is that Mayavi2 or not?
aptitude search mayavi
mayavi2
Ok, so Mayavi2 is the only version installed, so I guess Mayavi 4.0.0 is really a type of Mayavi2. You can also test Mayavi2 by typing
Mayavi2
from a terminal.
This pops up a window for me, but the colors make all the titles unreadable. Hrm. I can't see how to fix this. Annoying.

This packages a lot of these all together... for future reference and installing on a blank computer:
http://www.enthought.com/products/epd.php

Numpy is still lower than the version I want though. How do I upgrade to 1.7? I'm going to find out!
cd ./tmp
sudo pip install --upgrade numpy

python
import numpy
numpy.version.version
'1.7.0'
Great!

Ok, so the dependencies are all in place. My understanding is that you also need compilers if you want to use the code straight from launchpad. If you want to contribute code to launchpad, then you need a way of authenticating yourself. Those steps for later. For today, the dependencies are in place!

Monday, March 25, 2013

Python, installing the right version

I do all my programming in Python. I make heavy use of scipy, numpy, and matplotlib. I also like to do 3D plots in Mayavi. So, these are the packages that I need to make sure are up to date with the versions I want. How do I check this? If they are wrong, what's the best way to update the version? I'm going to find out!

Click on Dash Home
Type terminal
Hit Enter
Run python --version

(while the terminal is open, right click on the icon on the tray and choose to lock it there-- terminal is the starting point for most of my work.)

It turns out, I have
Python 2.7.3


There is a newer production version: Python 3.3.0 (Sept. 29, 2012) From what I read, it looks like it is not a good idea to erase 2.7.3. Rather, one may install 3.3.0 alongside 2.7.3.


I followed the instructions in this answer:
http://askubuntu.com/a/244550 (except with sudo in front of each line, and answered Y to each question)
The tar command takes quite a while (~2 minutes)

except instead of py, I called it py3

I got this error along the way:

running build
running build_ext
sh: 1: cannot create build/temp.linux-x86_64-3.3/multiarch: Permission denied
error: build/temp.linux-x86_64-3.3/multiarch: No such file or directory
make: *** [sharedmods] Error 1


I'm not sure what to make of that... is it a real problem?

Hm, per another website, I tried installing python3 like this:
sudo apt-get install python3

now:
python --version
Python 2.7.3

python3 --version
Python 3.2.3

Hrm. That's the version from April, not the most recent version. Maybe if I update and upgrade.

When I've tried a bunch of stuff like I did here, I'm never sure if it is the most recent line I ran that finally made the change, or all of the steps combined.

I'm surprised that 3.2.3 installed instead of 3.3.0 given that 3.3.0 is the "production version."

Hrm. Well, now I would expect to be able to run things with python and with python3, so that's good. But, I don't like feeling mystified by my inability to install 3.3.0. I also can't figure out how to make all the fonts in this entry identical. How annoying.

--> update, the font problem was with firefox, go to Edit -> Preferences -> Content -> Advanced -> Allow pages to choose their own fonts ... err... not quite fixed

Ubuntu: How to check OS version and get computer info

Linux-- I want to learn to love it, but there are just some serious annoyances at not knowing my way around. I'm going to figure them out and post them here so that I remember them, have a reference to go back to, and might even help someone else too.

I am looking at my desktop computer with the Ubuntu operating system installed. To get help, you often have to tell someone stats about your system. How do you find them? Let's see...

Click on the desktop
Mouse over the upper black bar
Click Help
Click Ubuntu Help

A window pops up that says "Welcome to Ubuntu 12.04 LTS," so that's the version I have. Ok, so that was easy to figure out and easy to remember. The more official way to check it is:

Click on Dash Home (top icon in the tray of icons)
Type system settings
Hit enter
Click details (bottom row)

Now I can see all kinds of details about my machine.

Ubuntu 12.04 LTS
Memory: 1.8 GiB
Processor: Intel Core 2 Duo DPU E8400 @ 3.00 GHz x 2
Graphics: Unknown
OS type: 64-bit
Disk: 155.6 GB

From here: https://wiki.ubuntu.com/LTS I learned that 12.04 is the most recent "Long Term Support" version, so I'm happy with that.The next version comes out in 2014.