MTK Installer

Added by Jeremy Wright almost 9 years ago

FYI - I've renamed our original installer script to mtk_setup_script_Ubuntu_14_04_Sage.sh and started over again with the IPython version in mtk_setup_script.sh


Replies (39)

RE: MTK Installer - Added by Jeremy Wright almost 9 years ago

This item is MTK-02 in our Yavin sprint 2 planning document .

RE: MTK Installer - Added by Christopher Sigman almost 9 years ago

In the future, we might want things installed via python embedded in a notebook we include. What made me think of this is looking over the docs for IPython Notebook Extensions, they talk about automatic loading of a notebook extension by running some python to get the location of the custom.js and adding the extension there. This would make it so that we don't have to dynamically load extensions in the notebooks all the time.

RE: MTK Installer - Added by Jeremy Wright almost 9 years ago

I made a minor update to the script so that you don't have to run it with super user privileges. It will prompt you for your password to use sudo on its own. Also, please note that the installer script sets up a virtual environment. You'll need to activate it to do the setup/running of IPython:

source venv/ipython-notebook/bin/activate

You should be able to run IPython at that point without doing any of the other steps in this post

http://127.0.0.1:8888/

RE: MTK Installer - Added by J. Simmons almost 9 years ago

I think I am running into sudo problems in the script. Here are the results of my trying to run it.

jrs@ubuntu:~/Downloads$ chmod +x ./mtk_setup_script.sh 
jrs@ubuntu:~/Downloads$ ls -al
total 16
drwxr-xr-x  3 jrs jrs 4096 Jul 30 21:15 .
drwxr-xr-x 17 jrs jrs 4096 Jul 30 21:14 ..
-rwxrwxr-x  1 jrs jrs 1853 Jul 30 21:15 mtk_setup_script.sh
drwxrwxr-x  3 jrs jrs 4096 May 26 10:04 VMWare-Tools
jrs@ubuntu:~/Downloads$ ./mtk_setup_script.sh 
Installing the Mach 30 Mathematics Tool Kit (MTK).
This can take awhile. Please be patient.
Running an initial update...
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
[sudo] password for jrs: 
root@ubuntu:/home/jrs/Downloads# 
root@ubuntu:/home/jrs/Downloads# ^C
root@ubuntu:/home/jrs/Downloads# exit
exit
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
jrs@ubuntu:~/Downloads$ 

RE: MTK Installer - Added by J. Simmons almost 9 years ago

As an experiment, I decided to use my spare testing time to check out Anaconda. I downloaded the Linux 64 bit Python 2.7 installer and then followed the I am getting started with Python from IPython (which recommend using Anaconda - something I had not really paid attention to originally). Everything went smooth as silk and I had a notebook up and running in no time. Also, note that I did not need root, it asked to install in my home directory.

RE: MTK Installer - Added by Jeremy Wright almost 9 years ago

Capturing this here so that we're all on the same page about installing plugins.

cd ~/.ipython/nbextensions
wget https://github.com/ipython-contrib/IPython-notebook-extensions/archive/3.x.zip
unzip 3.x.zip

RE: MTK Installer - Added by Jeremy Wright almost 9 years ago

The mention of using Anaconda on the IPython homepage is for if you don't have Python installed yet. Ubuntu 14.04 comes with Python.

http://ipython.org/install.html#i-am-getting-started-with-python

RE: MTK Installer - Added by Jeremy Wright almost 9 years ago

The latest commit of the installer script fixes the sudo issue and doesn't use a virtual environment.

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

I downloaded the Linux 64 bit Python 2.7 installer

J - So you want to use Python 2.7 instead of 3.4?

RE: MTK Installer - Added by J. Simmons over 8 years ago

Given Anaconda's ability to run multiple Python releases (meaning we can move up to 3.4 if needed) and CQ's current use of 2.7, I figured 2.7 was the safer bet for now.

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

Well, I started with 3.4 and got the install script working, so I'll back up and change that. The installer handles the nbextensions, I'm just trying to make sure they are working correctly before moving on.

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

This is working with nbextensions and PDF export included. I just need to test on a fresh VM.

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

Be sure to exit the terminal and start a new one after the installer completes. Even sourcing .bashrc doesn't pick up all the changes in the original terminal.

RE: MTK Installer - Added by J. Simmons over 8 years ago

Running installer now...

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

Let me know if you have any trouble with the nbextensions. If you have trouble, comment out everything in the script down to the `source` line and re-run the script.

I also just updated the script (~5 minutes ago) for a minor bug that kept the extensions zip file from being deleted after the install.

RE: MTK Installer - Added by J. Simmons over 8 years ago

I finished installing things from the commit before that. Install looks ok on first blush (just launching NB server, etc). Plan to do some actual testing later tonight and then wipe VM and run latest installer before I go to bed.

RE: MTK Installer - Added by J. Simmons over 8 years ago

And that didn't take long.... The version of the installer I ran deleted (or something?) the NB extensions. In better news, the PDF export worked right out of the gate (and I think it may address some of the concerns @CSS has raised around final formatting). Time to wipe the VM and try again.

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

The version of the installer I ran deleted (or something?) the NB extensions.

I think that should be fixed in the latest version of the installer. It was a copy-paste ID10T error on my part.

RE: MTK Installer - Added by J. Simmons over 8 years ago

Looks like the latest commit commented out the Anaconda installation steps. I am uncommenting the download anaconda step, the install anaconda step, and the source bashrc step. Updates forthcoming.

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

Ugh. I though I had double-checked that.

RE: MTK Installer - Added by J. Simmons over 8 years ago

It also looks like we are still running Python 3.4. I will admit, in my post trip fatigue, I am not sure.... Did we say we would move to Python 2.7 or not (I know I recommended it, but I lost the thread after that).

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

We talked about 2.7, but 3.4 was working great, so I just left it for now. The Anaconda lines are the only ones that would change.

RE: MTK Installer - Added by J. Simmons over 8 years ago

That makes sense. Just figured I would confirm where things were since I noticed it.

RE: MTK Installer - Added by J. Simmons over 8 years ago

Finished running installer (with those three lines uncommented) and I was able to start the notebook, but I am getting the following error:

ImportError                               Traceback (most recent call last)
<ipython-input-2-1fde7463ab1f> in <module>()
----> 1 from pint import UnitRegistry
      2 units = UnitRegistry()
      3 
      4 length = 2.5 * units.meter
      5 width = 2.0 * units.meter

ImportError: No module named 'pint'

So, is this related to the .bashrc issue? Should you run pip from a full path instead of using the one from $PATH?

RE: MTK Installer - Added by Jeremy Wright over 8 years ago

What happens if you start a regular Python console and type import pint?

1 2 Next » (1-25/39)