pygraphviz icon indicating copy to clipboard operation
pygraphviz copied to clipboard

installation failing in kaggle notebook

Open thebinarycode opened this issue 4 years ago • 1 comments

I tried the below command, any workaround for this? pip install --global-option=build_ext
--global-option="-L/opt/lib/mygviz/"
--global-option="-R/opt/lib/mygviz/"
pygraphviz

error: /opt/conda/lib/python3.7/site-packages/pip/_internal/commands/install.py:230: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option. cmdoptions.check_install_build_global(options) Collecting pygraphviz Using cached pygraphviz-1.7.zip (118 kB) Skipping wheel build for pygraphviz, due to binaries being disabled for it. Installing collected packages: pygraphviz Running setup.py install for pygraphviz ... error ERROR: Command errored out with exit status 1: command: /opt/conda/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ne8iejnh/pygraphviz_c73cc2dce14c477994fa3d3a3aad8ff5/setup.py'"'"'; file='"'"'/tmp/pip-install-ne8iejnh/pygraphviz_c73cc2dce14c477994fa3d3a3aad8ff5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' build_ext -L/opt/lib/mygviz/ -R/opt/lib/mygviz/ install --record /tmp/pip-record-hqb6eeib/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.7m/pygraphviz cwd: /tmp/pip-install-ne8iejnh/pygraphviz_c73cc2dce14c477994fa3d3a3aad8ff5/ Complete output (11 lines): running build_ext building 'pygraphviz._graphviz' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/pygraphviz gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/include/python3.7m -c pygraphviz/graphviz_wrap.c -o build/temp.linux-x86_64-3.7/pygraphviz/graphviz_wrap.o pygraphviz/graphviz_wrap.c:2711:10: fatal error: graphviz/cgraph.h: No such file or directory #include "graphviz/cgraph.h" ^~~~~~~~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /opt/conda/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ne8iejnh/pygraphviz_c73cc2dce14c477994fa3d3a3aad8ff5/setup.py'"'"'; file='"'"'/tmp/pip-install-ne8iejnh/pygraphviz_c73cc2dce14c477994fa3d3a3aad8ff5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' build_ext -L/opt/lib/mygviz/ -R/opt/lib/mygviz/ install --record /tmp/pip-record-hqb6eeib/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.7m/pygraphviz Check the logs for full command output.

thebinarycode avatar Apr 20 '21 04:04 thebinarycode

You are explicitly providing the path to the graphviz libs, but not the headers. When providing explicit paths you need to provide both - given the paths above, probably something like --global-options="-I/opt/include" but that will depend on how graphviz is installed on your system.

I don't think the -R flag is necessary; I would try building without it. If you have problems with library resolution at runtime you can always rebuild with that option.

rossbar avatar Apr 20 '21 06:04 rossbar