質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Python 2.7

Python 2.7は2.xシリーズでは最後のメジャーバージョンです。Python3.1にある機能の多くが含まれています。

Q&A

解決済

2回答

2684閲覧

ライブラリーリサーチのための対話環境をJupyter Notebookの上につくってみたい@MonkeyBench

yurayura_party

総合スコア11

Python 2.7

Python 2.7は2.xシリーズでは最後のメジャーバージョンです。Python3.1にある機能の多くが含まれています。

1グッド

0クリップ

投稿2016/04/16 17:44

###前提・実現したいこと
ライブラリーリサーチのための対話環境をJupyter Notebookの上につくってみたい@MonkeyBench
###発生している問題・エラーメッセージ
###notebook上のエラー

--------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-8-a730a8649d77> in <module>() ----> 1 get_ipython().magic(u'load_ext MonkeyBench') /Users/(ユーザー名)/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s) 2161 magic_name, _, magic_arg_s = arg_s.partition(' ') 2162 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC) -> 2163 return self.run_line_magic(magic_name, magic_arg_s) 2164 2165 #------------------------------------------------------------------------- /Users/(ユーザー名)/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line) 2082 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals 2083 with self.builtin_trap: -> 2084 result = fn(*args,**kwargs) 2085 return result 2086 <decorator-gen-64> in load_ext(self, module_str) /Users/(ユーザー名)/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k) 191 # but it's overkill for just that one bit of state. 192 def magic_deco(arg): --> 193 call = lambda f, *a, **k: f(*a, **k) 194 195 if callable(arg): /Users/(ユーザー名)/anaconda/lib/python2.7/site-packages/IPython/core/magics/extension.pyc in load_ext(self, module_str) 64 if not module_str: 65 raise UsageError('Missing module name.') ---> 66 res = self.shell.extension_manager.load_extension(module_str) 67 68 if res == 'already loaded': /Users/(ユーザー名)/anaconda/lib/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self, module_str) 82 if module_str not in sys.modules: 83 with prepended_to_syspath(self.ipython_extension_dir): ---> 84 __import__(module_str) 85 mod = sys.modules[module_str] 86 if self._call_load_ipython_extension(mod): /Users/(ユーザー名)/.ipython/extensions/MonkeyBench.py in <module>() 74 from IPython.core.magic import (register_line_magic, register_cell_magic) 75 from StringIO import StringIO ---> 76 import pygraphviz as pgv 77 import cStringIO 78 ImportError: No module named pygraphviz

###該当のソースコード

python2.7

1%load_ext MonkeyBench

###試したこと
3時間ほどgoogleで検索したのですが、リリース直後ということもあり、分からないことだらけです。
御一助いただければ幸いです。

###補足情報(言語/FW/ツール等のバージョンなど)
http://readingmonkey.blog45.fc2.com/
https://gist.github.com/kurubushi--rm

ikuwow👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

すみません。製作者です。ご苦労かけます。
MonkeyBenchで使ってるパッケージは、ほとんどAnacondaに入っているのですが、
pygraphvizは改めてインストールしないといけないようです。

Anacondaでのpygraphvizですが、次の方法を試してみてください。

(linux, osx)
conda install -c https://conda.anaconda.org/pdrops pygraphviz

(windows)
conda install -c https://conda.anaconda.org/rhishi pygraphviz

(参考)
https://anaconda.org/pdrops/pygraphviz
https://anaconda.org/rhishi/pygraphviz

投稿2016/04/17 11:31

kurubushi_rm

総合スコア18

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yurayura_party

2016/04/17 12:16

直接、読書猿さんに師事をいただく日が来るなんて・・・感激です。うまくいきました。素晴らしいツールをありがとうございます。
guest

0

ベストアンサー

pygraphvizがインストールされていないだけでは?


追記:

「ImportError: No module named」で検索したら、インポートされていない場合の対処がいくつか出てきます。その辺りをご参照ください。
ImportError: No module named - Google 検索

投稿2016/04/16 17:54

編集2016/04/17 05:22
kei344

総合スコア69364

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yurayura_party

2016/04/17 04:59

回答ありがとうございます。 pip install pygraphviz をしてみたのですが以下のようになりました ERROR: unknown command "pygraphviz" yh:~ yh$ pip install pygraphviz [Collecting pygraphviz Using cached pygraphviz-1.3.1.tar.gz Building wheels for collected packages: pygraphviz Building wheel for pygraphviz failed: [Errno 13] Permission denied: '/Users/yh/Library/Caches/pip/wheels/54' Failed to build pygraphviz Installing collected packages: pygraphviz Running setup.py install for pygraphviz ... error Complete output from command /Users/yh/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hh/1n8xs8z12pd2t6q69ls3ys0m0000gn/T/pip-build-7gNMVh/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/hh/1n8xs8z12pd2t6q69ls3ys0m0000gn/T/pip-PfBMli-record/install-record.txt --single-version-externally-managed --compile: running install Trying pkg-config include_dirs=/usr/local/Cellar/graphviz/2.38.0/include/graphviz library_dirs=/usr/local/Cellar/graphviz/2.38.0/lib running build running build_py creating build creating build/lib.macosx-10.5-x86_64-2.7 creating build/lib.macosx-10.5-x86_64-2.7/pygraphviz copying pygraphviz/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz copying pygraphviz/agraph.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz copying pygraphviz/graphviz.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz copying pygraphviz/release.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz copying pygraphviz/version.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz creating build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_attributes.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_clear.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_drawing.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_edge_attributes.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_graph.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_html.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_layout.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_node_attributes.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_readwrite.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_string.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_subgraph.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests copying pygraphviz/tests/test_unicode.py -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz/tests running egg_info writing pygraphviz.egg-info/PKG-INFO writing top-level names to pygraphviz.egg-info/top_level.txt writing dependency_links to pygraphviz.egg-info/dependency_links.txt warning: manifest_maker: standard file '-c' not found reading manifest file 'pygraphviz.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*~' found anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '.svn' found anywhere in distribution no previously-included directories found matching 'doc/build' writing manifest file 'pygraphviz.egg-info/SOURCES.txt' copying pygraphviz/graphviz.i -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz copying pygraphviz/graphviz_wrap.c -> build/lib.macosx-10.5-x86_64-2.7/pygraphviz running build_ext building 'pygraphviz._graphviz' extension creating build/temp.macosx-10.5-x86_64-2.7 creating build/temp.macosx-10.5-x86_64-2.7/pygraphviz gcc -fno-strict-aliasing -I/Users/yh/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/graphviz/2.38.0/include/graphviz -I/Users/yh/anaconda/include/python2.7 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.5-x86_64-2.7/pygraphviz/graphviz_wrap.o pygraphviz/graphviz_wrap.c:2954:10: fatal error: 'graphviz/cgraph.h' file not found #include "graphviz/cgraph.h" ^ 1 error generated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/Users/yh/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hh/1n8xs8z12pd2t6q69ls3ys0m0000gn/T/pip-build-7gNMVh/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/hh/1n8xs8z12pd2t6q69ls3ys0m0000gn/T/pip-PfBMli-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/hh/1n8xs8z12pd2t6q69ls3ys0m0000gn/T/pip-build-7gNMVh/pygraphviz/ よろしくお願いいたします
kei344

2016/04/17 05:23

すいませんが、遠隔でのインストールのサポートは私の技量ではできません。
yurayura_party

2016/04/17 12:18

動きました!感動です。プログラミングなんてしたことなかったのに...感謝、感謝です。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問