Skip to content
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

Problem installing pygraphviz #22

Closed
biotom opened this issue Aug 16, 2020 · 8 comments
Closed

Problem installing pygraphviz #22

biotom opened this issue Aug 16, 2020 · 8 comments
Labels
good first issue Good for newcomers

Comments

@biotom
Copy link
Contributor

biotom commented Aug 16, 2020

When I try and run 'pip install -r requirements.txt', it fails with the error: ERROR: Command errored out with exit status 1: command: /Users/ittd/climatemind-backend/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/setup.py'"'"'; __file__='"'"'/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/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 /private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-record-9cpocl9v/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ittd/climatemind-backend/venv/include/site/python3.7/pygraphviz cwd: /private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/ Complete output (33 lines): running install Trying dpkg Failed to find dpkg Trying pkg-config Package libcgraph was not found in the pkg-config search path. Perhaps you should add the directory containing 'libcgraph.pc' to the PKG_CONFIG_PATH environment variable No package 'libcgraph' found Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/setup.py", line 93, in <module> tests_require=['nose>=1.3.7', 'doctest-ignore-unicode>=0.1.2', 'mock>=2.0.0'], File "/Users/ittd/climatemind-backend/venv/lib/python3.7/site-packages/setuptools/__init__.py", line 163, in setup return distutils.core.setup(**attrs) File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/setup_commands.py", line 44, in modified_run self.include_path, self.library_path = get_graphviz_dirs() File "/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/setup_extra.py", line 162, in get_graphviz_dirs include_dirs, library_dirs = _try_configure(include_dirs, library_dirs, _pkg_config) File "/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/setup_extra.py", line 117, in _try_configure i, l = try_function() File "/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/setup_extra.py", line 72, in _pkg_config output = S.check_output(['pkg-config', '--libs-only-L', 'libcgraph']) File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 376, in check_output **kwargs).stdout File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 468, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['pkg-config', '--libs-only-L', 'libcgraph']' returned non-zero exit status 1. ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/ittd/climatemind-backend/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/pygraphviz/setup.py'"'"'; __file__='"'"'/private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-install-56vasmf8/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 /private/var/folders/3j/dq8385xs2b3gr_w7yxrqbvjr0000gs/T/pip-record-9cpocl9v/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ittd/climatemind-backend/venv/include/site/python3.7/pygraphviz Check the logs for full command output.
This happens also when I try and run pip install pygraphviz

@rodriguesk
Copy link
Member

You don't need pygraphviz to run the app. I suggest looking back to an earlier versions of the repo before visualize.py was added to the knowledge_graph folder.

@ppython I'm thinking it might be good to move the visualize script to a different repo, one that's internal only, especially since the visualize.py script isn't going to be run by the app.

@rodriguesk
Copy link
Member

rodriguesk commented Aug 16, 2020

@biotom if you do want to install graphviz and you have a mac, then follow these directions to fix the dependency issue:

I had issues getting pip install pygraphviz to work on my mac. I had to download pygraphviz from the zip file on their website, then unzip and include the special arguments in the install command to include the proper path to Graphviz installed on my mac.

For mac, after installing Graphviz, to install pygraphivz providing path to graphviz (from the install documentation for pygraphviz):

We tried our best to discover graphviz location automatically, but if you
would like specify specific location for graphviz you may provide additional parameters to specify graphviz location in the setup.py file in the zip or tar file.
include-path= path to graphviz include files
library-path= path to graphviz library files
For example
::
python setup.py install --include-path=/usr/local/Cellar/graphviz/2.38.0/include/graphviz --library-path=/usr/local/Cellar/graphviz/2.38.0/lib

Note that Graphviz is different than the pygraphviz python package. Graphviz is separate software that can be downloaded if you have a mac and have homebrew by doing brew install graphviz. If you have a PC try to follow the instructions here to get pygraphviz and Graphviz working.

@rodriguesk
Copy link
Member

@biotom Try using this state of the repo to work off of for Swagger:
b8d8b3a#diff-d7b6a4b835cd70aa17e6993900a57dbe

@biotom
Copy link
Contributor Author

biotom commented Aug 16, 2020

Thanks, after brew install graphviz, it worked! However, I'm now getting ModuleNotFoundError: No module named 'pandas' when I try and do flask run... @rolandoldengarm is it worth dockerising this now?

@rodriguesk
Copy link
Member

rodriguesk commented Aug 16, 2020 via email

@biotom
Copy link
Contributor Author

biotom commented Aug 16, 2020

Yes, I've done this- and so has pip install -r requirements.txt

@rodriguesk
Copy link
Member

rodriguesk commented Aug 17, 2020 via email

@rodriguesk rodriguesk added the good first issue Good for newcomers label Aug 18, 2020
@biotom
Copy link
Contributor Author

biotom commented Aug 18, 2020

With the docker container developments, and the fact that installing graphviz fixed this, I think we can close this issue.

@biotom biotom closed this as completed Aug 18, 2020
gitbook-com bot pushed a commit that referenced this issue Oct 14, 2022
danmash added a commit that referenced this issue Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants