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

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

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

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

解決済

1回答

6188閲覧

pygraphvizをうまくインストール出来ません。

TomoyaMaruyama

総合スコア7

Python 2.7

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

0グッド

0クリップ

投稿2016/09/17 12:09

編集2016/09/17 13:03

pygraphvizをうまくインストール出来ませんので対処法を教えていただきたいです。

1.graphvizはpkgを使ってインストールしました。
2.そのあとでpipでpygraphvizをインストールしようとしたら以下のようにエラーが出ました。

Collecting pygraphviz Using cached pygraphviz-1.3.1.zip Building wheels for collected packages: pygraphviz Running setup.py bdist_wheel for pygraphviz ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/c0/0kzgkqw92qq4wplfvdqx_czh0000gn/T/pip-build-uuALX9/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/c0/0kzgkqw92qq4wplfvdqx_czh0000gn/T/tmpeNTXyZpip-wheel- --python-tag cp27: running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.10-intel-2.7 creating build/lib.macosx-10.10-intel-2.7/pygraphviz copying pygraphviz/__init__.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz copying pygraphviz/agraph.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz copying pygraphviz/graphviz.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz copying pygraphviz/release.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz copying pygraphviz/version.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz creating build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/__init__.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_attributes.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_clear.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_drawing.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_edge_attributes.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_graph.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_html.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_layout.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_node_attributes.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_readwrite.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_string.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_subgraph.py -> build/lib.macosx-10.10-intel-2.7/pygraphviz/tests copying pygraphviz/tests/test_unicode.py -> build/lib.macosx-10.10-intel-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.10-intel-2.7/pygraphviz copying pygraphviz/graphviz_wrap.c -> build/lib.macosx-10.10-intel-2.7/pygraphviz running build_ext building 'pygraphviz._graphviz' extension creating build/temp.macosx-10.10-intel-2.7 creating build/temp.macosx-10.10-intel-2.7/pygraphviz cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.10-intel-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 'cc' failed with exit status 1 ---------------------------------------- Failed building wheel for pygraphviz Running setup.py clean for pygraphviz Failed to build pygraphviz Installing collected packages: pygraphviz Running setup.py install for pygraphviz ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/c0/0kzgkqw92qq4wplfvdqx_czh0000gn/T/pip-build-uuALX9/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/c0/0kzgkqw92qq4wplfvdqx_czh0000gn/T/pip-FKX_ud-record/install-record.txt --single-version-externally-managed --compile: running install Trying pkg-config Failed to find pkg-config Trying dotneato-config Failed to find dotneato-config Failed to find dotneato-config Your Graphviz installation could not be found. 1) You don't have Graphviz installed: Install Graphviz (http://graphviz.org) 2) Your Graphviz package might incomplete. Install the binary development subpackage (e.g. libgraphviz-dev or similar.) 3) You are using Windows There are no PyGraphviz binary packages for Windows but you might be able to build it from this source. See http://networkx.lanl.gov/pygraphviz/reference/faq.html If you think your installation is correct you will need to manually change the include_dirs and library_dirs variables in setup.py to point to the correct locations of your graphviz installation. The current setting of library_dirs and include_dirs is: library_dirs=None include_dirs=None error: Error locating graphviz. ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/c0/0kzgkqw92qq4wplfvdqx_czh0000gn/T/pip-build-uuALX9/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/c0/0kzgkqw92qq4wplfvdqx_czh0000gn/T/pip-FKX_ud-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/c0/0kzgkqw92qq4wplfvdqx_czh0000gn/T/pip-build-uuALX9/pygraphviz/

3.次にこのサイトに書いてある手続きを行ってsetup.pyを用いたインストールを試みたところ以下のエラーが出ました。
4.環境は mac=10.10.5, python=2.7.10, graphviz=2.36.0 です。
*graphvizのインストール先は3のサイトと一致していました。

python setup.py install running install Trying pkg-config Failed to find pkg-config include_dirs=/usr/local/include/graphviz/ library_dirs=/usr/local/lib/graphviz/ running build running build_py 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 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' running build_ext building 'pygraphviz._graphviz' extension cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/local/include/graphviz/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.10-intel-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 'cc' failed with exit status 1

ご回答よろしくお願いします。

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

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

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

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

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

guest

回答1

0

自己解決

フォルダ内のsetup-extra.pyの101行目、102行目の

python

1#library_dirs='/usr/local/lib/graphviz' 2#include_dirs='/usr/local/include/graphviz'

python

1library_dirs='/usr/local/lib/' 2include_dirs='/usr/local/include/'

と変更

投稿2016/09/17 15:02

TomoyaMaruyama

総合スコア7

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問