django - 我想在 django 中可视化数据库图,但在 pygraphviz 中出现问题
问题描述
我正在尝试在 django 中可视化数据库图。
在 Docker 文件中,我有:
运行 apt-get install -y python3-dev graphviz libgraphviz-dev 运行 apt-get install -y python-pygraphviz pkg-config
在 requirements.txt 我有:
django、psycopg2、djangorestframework、PyJWT、gunicorn、频道、django 扩展、graphviz、cGraph、pygraphviz
但我收到此错误:
Building wheel for pygraphviz (setup.py): started
Building wheel for pygraphviz (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ...
----------------------------------------
ERROR: Failed building wheel for pygraphviz
Running setup.py clean for pygraphviz
Successfully built cGraph
Failed to build pygraphviz ... ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
关于这个错误的任何想法?
解决方案
我认为你有错误的包,试试看
docker-compose <-f local.yml> run --rm <containername> pip install graphviz
或将其添加到您的要求中:
graphviz==0.16 or 0.1*
还将您的 Dockerfile RUN 更改为:
RUN pip install -r /requirements/local.txt
不要调用每个库。
有点晚了,但希望能有所帮助,干杯。
推荐阅读
- hazelcast - 没有驱逐策略的 Hazelcast 地图最大尺寸配置
- flutter - Dart - 循环导入
- function - log_2(n+1)-log_3(2n+1)=O(1)吗?
- python - 未应用于生产的更改
- knockout.js - 淘汰赛:绑定到包含句点的 ID?
- terminal - zsh 使用命令标志作为目录?
- javascript - 切片数组并从中生成对象
- geopandas - Google Colab 中的 Geopandas
- scala - scala.collection.mutable.Map 抽象时如何扩展?
- localhost - kubectl port-forward 未绑定 IPv4 环回地址 127.0.0.1