Python: Installation issues with pygraphviz and graphviz

后端 未结 3 1475
逝去的感伤
逝去的感伤 2020-12-15 07:31

I see many questions on the difficulties of properly installing pygraphviz and graphviz on Windows for Python 2.7. But no answers that I have found

相关标签:
3条回答
  • 2020-12-15 07:42

    You may first install "easy_install" (look at How to use Python's "easy_install" on Windows ... it's not so easy) then 2 packages are required: 'python-pygraph' & 'libgv-python'.

    0 讨论(0)
  • 2020-12-15 07:55

    You'll find loads of install-ready packages on this site: http://www.lfd.uci.edu/~gohlke/pythonlibs/ including the ones you tried to install. I know I'm way too late with the answer but I just became a member.

    0 讨论(0)
  • 2020-12-15 07:57

    Here are the steps I followed to get pygraphviz working for Python 3.4 (I think if you follow the analogous steps, it should work for Python 2.x). I'm just documenting it here for future visitors to the page :

    Pre-requisites :

    1. wheel (Should be present by default in newer distributions)
    2. The correct Windows build of pygraphviz (unofficial builds). On Win7 x64, I selected "pygraphviz‑$version-cp34‑none‑win_amd64.whl". (Note the cp34 indicating the python version.)
    3. The Graphviz installer version 2.38 (for which the above wheel is built)

    Steps:

    1. Run the Graphviz installer
    2. Add the Graphviz\bin folder to your user or system PATH
    3. Check: Open a command prompt and execute twopi -V. You should be able to see the Graphviz version printed onto the console.
    4. Now go to your Python environment (e.g. by running anaconda.bat, a prompt where you can run python)
    5. Run pip install pygraphviz‑*$version*-cp34‑none‑win_amd64.whl
    6. You're done :) ! Run an example script to see if everything went well.
    0 讨论(0)
提交回复
热议问题