Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
469 views
in Technique[技术] by (71.8m points)

graphviz - How to use pygraphviz on rsconnect

I am using pygraphviz in order to calculate positioning of a network graph which I display in networkx. The graph is the displayed in a plotly dash application. I can run the dash app locally just fine but when I try to deploy it to rsconnect I get the following error message:

Running setup.py install for pygraphviz: started
2021/01/27 12:17:48.867526567     Running setup.py install for pygraphviz: finished with status 'error'
2021/01/27 12:17:48.867775192     ERROR: Command errored out with exit status 1:
2021/01/27 12:17:48.867786700      command: /opt/rstudio-connect/mnt/app/python/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup.py'"'"'; _
_file__='"'"'/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '
"'"'exec'"'"'))' install --record /opt/rstudio-connect/mnt/tmp/pip-record-h5km5glz/install-record.txt --single-version-externally-managed --compile --install-headers /opt/rstudio-connect/mnt/app/python/env/include/site/python3.6/pyg
raphviz
2021/01/27 12:17:48.867837510          cwd: /opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/
2021/01/27 12:17:48.867839112     Complete output (33 lines):
2021/01/27 12:17:48.867850236     running install
2021/01/27 12:17:48.867850999     Trying dpkg
2021/01/27 12:17:48.867860939     Failed to find dpkg
2021/01/27 12:17:48.867861670     Trying pkg-config
2021/01/27 12:17:48.867871538     Package libcgraph was not found in the pkg-config search path.
2021/01/27 12:17:48.867872402     Perhaps you should add the directory containing `libcgraph.pc'
2021/01/27 12:17:48.867886192     to the PKG_CONFIG_PATH environment variable
2021/01/27 12:17:48.867887128     No package 'libcgraph' found
2021/01/27 12:17:48.867896503     Traceback (most recent call last):
2021/01/27 12:17:48.867897447       File "<string>", line 1, in <module>
2021/01/27 12:17:48.867906439       File "/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup.py", line 93, in <module>
2021/01/27 12:17:48.867907511         tests_require=['nose>=1.3.7', 'doctest-ignore-unicode>=0.1.2', 'mock>=2.0.0'],
2021/01/27 12:17:48.867922534       File "/opt/rstudio-connect/mnt/app/python/env/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
2021/01/27 12:17:48.867935411         return distutils.core.setup(**attrs)
2021/01/27 12:17:48.867957630       File "/opt/bee_tools/anaconda/lib/python3.6/distutils/core.py", line 148, in setup
2021/01/27 12:17:48.867959010         dist.run_commands()
2021/01/27 12:17:48.867969308       File "/opt/bee_tools/anaconda/lib/python3.6/distutils/dist.py", line 955, in run_commands
2021/01/27 12:17:48.867970168         self.run_command(cmd)
2021/01/27 12:17:48.867979439       File "/opt/bee_tools/anaconda/lib/python3.6/distutils/dist.py", line 974, in run_command
2021/01/27 12:17:48.867980339         cmd_obj.run()
2021/01/27 12:17:48.867991279       File "/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup_commands.py", line 44, in modified_run
2021/01/27 12:17:48.867992095         self.include_path, self.library_path = get_graphviz_dirs()
2021/01/27 12:17:48.868003692       File "/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup_extra.py", line 162, in get_graphviz_dirs
2021/01/27 12:17:48.868004480         include_dirs, library_dirs = _try_configure(include_dirs, library_dirs, _pkg_config)
2021/01/27 12:17:48.868013709       File "/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup_extra.py", line 117, in _try_configure
2021/01/27 12:17:48.868014420         i, l = try_function()
2021/01/27 12:17:48.868034322       File "/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup_extra.py", line 72, in _pkg_config
2021/01/27 12:17:48.868049989         output = S.check_output(['pkg-config', '--libs-only-L', 'libcgraph'])
2021/01/27 12:17:48.868075787       File "/opt/bee_tools/anaconda/lib/python3.6/subprocess.py", line 356, in check_output
2021/01/27 12:17:48.868083206         **kwargs).stdout
2021/01/27 12:17:48.868094107       File "/opt/bee_tools/anaconda/lib/python3.6/subprocess.py", line 438, in run
2021/01/27 12:17:48.868094807         output=stdout, stderr=stderr)
2021/01/27 12:17:48.868103721     subprocess.CalledProcessError: Command '['pkg-config', '--libs-only-L', 'libcgraph']' returned non-zero exit status 1.
2021/01/27 12:17:48.868110051     ----------------------------------------
2021/01/27 12:17:48.868255959 ERROR: Command errored out with exit status 1: /opt/rstudio-connect/mnt/app/python/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/opt/rstudio-connect/mnt/tmp/pip-install-wpo
0hxh6/pygraphviz/setup.py'"'"'; __file__='"'"'/opt/rstudio-connect/mnt/tmp/pip-install-wpo0hxh6/pygraphviz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close
();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /opt/rstudio-connect/mnt/tmp/pip-record-h5km5glz/install-record.txt --single-version-externally-managed --compile --install-headers /opt/rstudio-connect/mnt/app/pyth
on/env/include/site/python3.6/pygraphviz Check the logs for full command output.
2021/01/27 12:18:29.458083590 pip install failed with exit code 1
Build error: exit status 1
Error: Task exited with status 1.

How can I make it work?

question from:https://stackoverflow.com/questions/65919146/how-to-use-pygraphviz-on-rsconnect

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...