書籍「はじめての深層学習プログラミング」の環境構築を終えて、いざサンプルコードを実行してみたのですが、以下のようなエラーが出ます。

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    from deel.network import *
  File "build/bdist.linux-i686/egg/deel/network/__init__.py", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/chainer/__init__.py", line 3, in <module>
    import pkg_resources
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2760, in <module>
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 738, in subscribe
    callback(dist)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2760, in <lambda>
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2314, in activate
    for pkg in self._get_metadata('namespace_packages.txt'):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2305, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1369, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1361, in get_metadata
    return self._get(self._fn(self.egg_info,name))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1470, in _get
    stream = open(path, 'rb')
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/protobuf-3.1.0.post1-py2.7.egg/EGG-INFO/namespace_packages.txt'
~ 

4行目の

   File "build/bdist.linux-i686/egg/deel/network/__init__.py", line 1, in <module>

についてですが、

    find / -name "bdist.linux-i686"

して実際のディレクトリを探したところbdist.linux-i686ディレクトリはあったのですが(場所:deel/build/bdist.linux-i686)中身が空でした。

また最後にPermission denied:とあるのでsudoをつけて実行すると

Traceback (most recent call last):


File "test.py", line 2, in <module>
    from deel.network import *
  File "build/bdist.linux-i686/egg/deel/network/__init__.py", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/chainer/__init__.py", line 25, in <module>
    from chainer import serializers  # NOQA
  File "/usr/local/lib/python2.7/dist-packages/chainer/serializers/__init__.py", line 1, in <module>
    from chainer.serializers import hdf5
  File "/usr/local/lib/python2.7/dist-packages/chainer/serializers/hdf5.py", line 8, in <module>
    import h5py
  File "/usr/local/lib/python2.7/dist-packages/h5py-2.6.0-py2.7-linux-i686.egg/h5py/__init__.py", line 34, in <module>
    from ._conv import register_converters as _register_converters
  File "h5py/h5t.pxd", line 14, in init h5py._conv (/tmp/easy_install-lp3ofH/h5py-2.6.0/h5py/_conv.c:7527)
  File "h5py/numpy.pxd", line 66, in init h5py.h5t (/tmp/easy_install-lp3ofH/h5py-2.6.0/h5py/h5t.c:20799)
ValueError: numpy.dtype has the wrong size, try recompiling. Expected 52, got 56

というエラーがでます。

numpy関係のエラーだと思いますが、easy_installでnumpyを再インストールしてもダメでした。

何か解決のヒントなどいただけたら幸いです。

環境: Ubuntu 14.04, Python 2.7