-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot install pygraphviz on Mac OS 10.11.6 #100
Comments
$ pip install --install-option="--include-path=/usr/local/include/" --install-option="--library-path=/usr/local/lib/" pygraphviz Both path in bold should NOT contain "graphviz". |
Actually paths should include "graphviz". My mistake was that I was trying to install graphviz with pip instead of pygraphviz. Sorry for the inconvenience. |
fwiw I just had the same problem - was following the dask tutorial and initially tried installing pygraphviz and graphviz inside a conda env. That didn't work - but installing them both globally seems to have solved it. I also added the graphviz path to my .bash_profile, not sure if that was really necessary. |
Use |
@iamihgam what conda, python, and operating system/version do you have? I have (python3_test) jespinozlt-osx:~ jespinoz$ conda install pygraphviz
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- defaults/osx-64::dbus==1.12.2=h5243cc1_1
- pygraphviz
- r/osx-64::r-xtable==1.8_2=r342hb9d8108_0
Use "conda info <package>" to see the dependencies for each package. Here are my versions:
|
@jolespin |
tryp updating conda |
Just updated my conda :(
I think it has to do with my backend? |
For me, brew install placed the bin appropriately, but when I attempted to
Thank you for the help! |
Thanks @abrahamrhoffman I tried my version of this but still got an error: pip install --install-option="--include-path=~/anaconda/envs/python3_test/include/graphviz/" --install-option="--library-path=~/anaconda/envs/python3_test/lib/graphviz/" pygraphviz It looks like the original source for this is: Installation error: (python3_test) jespinozlt-osx:~ jespinoz$ pip install --install-option="--include-path=~/anaconda/envs/python3_test/include/graphviz/" --install-option="--library-path=~/anaconda/envs/python3_test/lib/graphviz/" pygraphviz
/Users/jespinoz/anaconda/envs/python3_test/lib/python3.6/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting pygraphviz
Downloading https://files.pythonhosted.org/packages/98/bb/a32e33f7665b921c926209305dde66fe41003a4ad934b10efb7c1211a419/pygraphviz-1.3.1.tar.gz (103kB)
100% |████████████████████████████████| 112kB 1.4MB/s
Skipping bdist_wheel for pygraphviz, due to binaries being disabled for it.
Installing collected packages: pygraphviz
Running setup.py install for pygraphviz ... error
Complete output from command /Users/jespinoz/anaconda/envs/python3_test/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6z/5vbtz_gmkr76ftgc3149dvtr0003c0/T/pip-build-cb44s6jl/pygraphviz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/6z/5vbtz_gmkr76ftgc3149dvtr0003c0/T/pip-kyj15wnc-record/install-record.txt --single-version-externally-managed --compile --include-path=~/anaconda/envs/python3_test/include/graphviz/ --library-path=~/anaconda/envs/python3_test/lib/graphviz/:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/agraph.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/graphviz.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/release.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/version.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
creating build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_attributes.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_clear.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_drawing.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_edge_attributes.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_graph.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_html.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_layout.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_node_attributes.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_readwrite.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_string.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_subgraph.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_unicode.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
running egg_info
writing pygraphviz.egg-info/PKG-INFO
writing dependency_links to pygraphviz.egg-info/dependency_links.txt
writing top-level names to pygraphviz.egg-info/top_level.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'
copying pygraphviz/graphviz.i -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/graphviz_wrap.c -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/pygraphviz
x86_64-apple-darwin13.4.0-clang -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I~/anaconda/envs/python3_test/include/graphviz/ -I/Users/jespinoz/anaconda/envs/python3_test/include/python3.6m -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.9-x86_64-3.6/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 'x86_64-apple-darwin13.4.0-clang' failed with exit status 1
----------------------------------------
Command "/Users/jespinoz/anaconda/envs/python3_test/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6z/5vbtz_gmkr76ftgc3149dvtr0003c0/T/pip-build-cb44s6jl/pygraphviz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/6z/5vbtz_gmkr76ftgc3149dvtr0003c0/T/pip-kyj15wnc-record/install-record.txt --single-version-externally-managed --compile --include-path=~/anaconda/envs/python3_test/include/graphviz/ --library-path=~/anaconda/envs/python3_test/lib/graphviz/" failed with error code 1 in /private/var/folders/6z/5vbtz_gmkr76ftgc3149dvtr0003c0/T/pip-build-cb44s6jl/pygraphviz/ |
You're welcome @jolespin : Try removing graphviz and reinstalling it. Might do the trick. |
Finally got it working :) for my conda environment # PyGraphViz
conda install graphviz --yes
pip download git+git://github.com/pygraphviz/pygraphviz.git#egg=pygraphviz
unzip pygraphviz*.zip
cd pygraphviz
python setup.py install --include-path=$CONDA_PREFIX/include --library-path=$CONDA_PREFIX/lib
pip install pydot |
I have the same problem but I'm using pipenv. How to solve this in that case? |
|
lol, look at my comment from |
fwiw, I had these same issues on my mac today. I found that I wasn't able to install pygraphviz using pip, but pip3 worked. I don't use conda. :) |
anybody had luck with MacPorts?
when I try: I get
|
... answering myself... was did the port py37-pygraphviz - (but did not have the sys.path set to the right directory, so was stuck somewhere between what was said above.) |
I tried pip install --install-option="--include-path=/usr/local/include/" --install-option="--library-path=/usr/local/lib/" pygraphviz but it didn't work, got the error error: option --include-path not recognized with pip 21.2.4 on macOS 11.5. Instead the command pip install pygraphviz --global-option=build_ext --global-option="-I/usr/local/include" --global-option="-L/usr/local/lib" worked like a charm. |
Thank you @em1208! This solution worked for me too. |
The brew install did not worked any more on MacOS. |
I have installed graphviz on my Mac using:
brew install graphviz
Every time I'm trying to install pygraphviz with:
pip install pygraphviz
I get the following results:
I have tried to specify library_path and include_path with the following command:
pip install graphviz --install-option="--include-path=/usr/local/include/graphviz/" --install-option="--library-path=/usr/local/lib/graphviz"
But it tells me:
error: option --include-path not recognized
I have tried with "include-dirs" and "library_dirs" too but without success.
How can I install it successfully? Should I built it from source?
The text was updated successfully, but these errors were encountered: