pip install pygraphviz: No package 'libcgraph' found

前端 未结 6 1027
醉梦人生
醉梦人生 2021-01-31 01:20

I succeed in installing graphviz and cgraph with

$ sudo pip install graphviz
....
Successfully installed graphviz-0.5.1

$ sudo pip ins         


        
相关标签:
6条回答
  • 2021-01-31 01:38

    For fedora users:

    1. yum list available graphviz*
    2. select the appropriate package for your Fedora distribution
    3. sudo yum install 'graphviz-devel.x86_64'
    4. pip install pygraphviz
    0 讨论(0)
  • 2021-01-31 01:45

    For MacOS, I needed to do:

    $ brew install graphviz
    $ sudo pip install pygraphviz 
    
    0 讨论(0)
  • 2021-01-31 01:50

    For CentOS. As graphviz-devel is required to fix this issue, you will need to install it with yum. To do this you are required to add repo's where package is available. In my case Atomic repos worked fine.

    wget -q -O - http://www.atomicorp.com/installers/atomic | sh
    

    This will add atomic repos, then

    sudo yum install graphviz-devel
    

    And you should be able to perform

    pip install pygraphviz
    
    0 讨论(0)
  • 2021-01-31 01:58

    On macOS, I made it with,

    $ brew install graphviz
    $ sudo pip install pygraphviz
    
    0 讨论(0)
  • 2021-01-31 02:00

    I ran into this problem when creating a Dockerfile for Django with a python-alpine image.

    I was able to solve it thanks to this post adding the package "graphviz-dev" along with the rest of my app's dependencies.

    Example:

    #Install dependencies
    RUN apk add --update --no-cache --virtual .build-deps \
        build-base \
        alpine-sdk \
        postgresql-dev \
        libffi-dev \
        python3-dev \
        libffi-dev \
        jpeg-dev \
        zlib-dev \
        musl-dev \
        libpq \
        graphviz-dev \  
        && pip install --no-cache-dir -r /code/requirements_dev.txt \
        && find /usr/local \
            \( -type d -a -name test -o -name tests \) \
            -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
            -exec rm -rf '{}' +
    

    Regards

    0 讨论(0)
  • 2021-01-31 02:01
    sudo apt-get install python-dev graphviz libgraphviz-dev pkg-config
    

    or the following might be needed if you're using Python 3:

    sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config
    

    then

    pip install pygraphviz
    
    0 讨论(0)
提交回复
热议问题