Enable to use django-extensions with pygraphviz
I'm trying to use pygraphviz und开发者_如何学Pythoner Ubuntu 10.04 within my Django projects.
I used synaptic and it was installed without any problem.
I also installed django-extensions with synaptic (django-extensions has a tool that uses pygraphviz and this is the one that I need)
Now when I try to use django-extensions with pygraphviz
$ python manage.py graph_models -a -g -o model.png
I'm getting an
Error: need pygraphviz python module ( apt-get install python-pygraphviz )
How can I fix this ?
I was facing the same problem on an Ubuntu 14.04 machine and I solved it installing the missing packages as follows:
sudo apt-get install graphviz-dev
sudo pip install pygraphviz
I had the similar issue. I was able to install django-extensions
but pygraphviz was giving error.
To install pygraphviz I first installed the requirement using
sudo apt-get update
sudo apt-get install graphviz-dev
Then used the following command
Python2
sudo pip install pygraphviz
Python3
sudo pip3 install pygraphviz
After installing it globally I again installed it in virtual environment using
pip install pygraphviz #---> python2
pip3 install pygraphviz #---> python3
Just install python-pygraphviz
with synaptic the same way you did pygraphvis and django-extensions.
On mac, I got same errors too. I was using a Virtualenv, but this shouldn't change the procedure.
This is what I did:
brew install graphviz
pip install python-pygraphviz
Now, I have installed pygraphviz from source.
May be you can do this too: pip install pygraphviz
and then when I did python manage.py graph_models -a -o polls_models.png
, it worked.
First I run
$python manage.py graph_models -a -g -o model_vi.png
But I get an error!
Error: You need to install pygraphviz python module
I tried this
$sudo easy_install pygraphviz
But again I get an error
unable to install pygraphviz with easy_install
Later I tried this;
$brew install graphviz
If you get an error in this section you try
$brew doctor
And then;
You can run the real command.
$python manage.py graph_models -a -g -o model_vi.png
It works fine. Hope yours work fine!
apt-get install python-pygraphviz
read the error... i tried apt-get solution and works fine
you can also try with
sudo easy_install pygraphviz
(i suppose you have pip / easy_install on your computer)
精彩评论