Repository: jupyterhub/jupyterhub

Issue:
Install problem
I am trying to install Jupyter Hub on an Ubuntu 14.04 server.  I followed exact instructions in the README.

I get this error when running "pip install ."

```
moment#2.7.0 share/jupyter/static/components/moment

running css

error: [Errno 2] No such file or directory

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-3k3Avh-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-jqPTEE-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-3k3Avh-build
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4: ordinal not in range(128)
```

My pip version is:

```
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
```

and my bower version is

```
1.3.12
```

and my python version is

```
Python 2.7.6
```

Any idea what is going on?  What should I try?  Thanks in advance!
Matt



Discussion:
I am also running on Ubuntu 14.04. I think I had to get pip from git. (I'm working with a student to make complete instructions, but it is taking some time to put together). My versions:

``` shell
$ pip --version
pip 1.5.6 from /usr/local/lib/python2.7/dist-packages (python 2.7)
$ bower --version
1.3.11
$ python --version
Python 2.7.6
```

this is a unicode bug in pip. I'll see if I can find a workaround. _sigh_


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -133,7 +133,12 @@ class Bower(BaseCommand):
     user_options = []
     
     def run(self):
-        check_call(['bower', 'install', '--allow-root'])
+        try:
+            check_call(['bower', 'install', '--allow-root'])
+        except OSError as e:
+            print("Failed to run bower: %s" % e, file=sys.stderr)
+            print("You can install bower with `npm install -g bower`", file=sys.stderr)
+            raise
         # update data-files in case this created new files
         self.distribution.data_files = get_data_files()
 
@@ -152,13 +157,18 @@ def run(self):
         style_less = pjoin(static, 'less', 'style.less')
         style_css = pjoin(static, 'css', 'style.min.css')
         sourcemap = style_css + '.map'
-        check_call([
-            'lessc', '-x', '--verbose',
-            '--source-map-basepath={}'.format(static),
-            '--source-map={}'.format(sourcemap),
-            '--source-map-rootpath=../',
-            style_less, style_css,
-        ])
+        try:
+            check_call([
+                'lessc', '-x', '--verbose',
+                '--source-map-basepath={}'.format(static),
+                '--source-map={}'.format(sourcemap),
+                '--source-map-rootpath=../',
+                style_less, style_css,
+            ])
+        except OSError as e:
+            print("Failed to run lessc: %s" % e, file=sys.stderr)
+            print("You can install less with `npm install -g less`", file=sys.stderr)
+            raise
         # update data-files in case this created new files
         self.distribution.data_files = get_data_files()
 


Test patch: