forked from pygraphviz/pygraphviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.txt
167 lines (116 loc) · 5.1 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
*******
Install
*******
PyGraphviz requires:
- Python (version 3.9, 3.10, or 3.11)
- `Graphviz <https://www.graphviz.org/>`_ (version 2.46 or later)
- C/C++ Compiler
.. note::
These instructions assume you have Python and a C/C++ Compiler on your computer.
.. warning::
Do not use the default channels to install pygraphviz with ``conda``. The
conda-forge channel should be used instead::
conda install --channel conda-forge pygraphviz
- |conda-forge-ubuntu-badge|
- |conda-forge-macos-badge|
- |conda-forge-windows-badge|
.. |conda-forge-ubuntu-badge| image:: https://github.com/pygraphviz/pygraphviz/workflows/conda-forge-ubuntu/badge.svg
.. |conda-forge-macos-badge| image:: https://github.com/pygraphviz/pygraphviz/workflows/conda-forge-macos/badge.svg
.. |conda-forge-windows-badge| image:: https://github.com/pygraphviz/pygraphviz/workflows/conda-forge-windows/badge.svg
Recommended
===========
We recommend installing Python packages using `pip and virtual environments
<https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`_.
Linux
-----
We recommend installing Graphviz using your Linux system's package manager.
Below are examples for some popular distributions.
Ubuntu and Debian
~~~~~~~~~~~~~~~~~
.. code-block:: console
$ sudo apt-get install graphviz graphviz-dev
$ pip install pygraphviz
Fedora and Red Hat
~~~~~~~~~~~~~~~~~~
You may need to replace ``dnf`` with ``yum`` in the example below.
.. code-block:: console
$ sudo dnf install graphviz graphviz-devel
$ pip install pygraphviz
macOS
-----
We recommend installing Graphviz using the Homebrew package manager or MacPorts for macOS.
Homebrew
~~~~~~~~
.. code-block:: console
$ brew install graphviz
$ pip install pygraphviz
.. note::
Graphviz may be installed in a location that is not on the default search
path.
In this case, it may be necessary to manually specify the path to the
graphviz include and/or library directories, e.g. ::
pip install --use-pep517 \
--config-setting="--global-option=build_ext" \
--config-setting="--build-option=-I$(brew --prefix graphviz)/include/" \
--config-setting="--build-option=-L$(brew --prefix graphviz)/lib/" \
pygraphviz
See the Advanced section for details.
MacPorts
~~~~~~~~
.. code-block:: console
$ port install graphviz
$ pip install pygraphviz
$ pip install --use-pep517 \
--config-setting="--global-option=build_ext" \
--config-setting="--global-option="-I/opt/local/include/" \
--config-setting="--global-option="-L/opt/local/lib/" \
pygraphviz
Advanced
========
The two main difficulties are
1. installing Graphviz and
2. informing pip where Graphviz is installed.
Providing path to Graphviz
--------------------------
If you've installed Graphviz and ``pip`` is unable to find Graphviz, then you need to
provide ``pip`` with the path(s) where it can find Graphviz.
To do this, you first need to figure out where the binary files, includes files, and
library files for Graphviz are located on your file system.
Once you know where you've installed Graphviz, you will need to do something like
the following. There is an additional example using Chocolatey on Windows further
down the page.
.. _windows-install:
Windows
-------
Historically, installing Graphviz and PyGraphviz on Windows has been challenging.
Fortunately, the Graphviz developers are working to fix this and
their recent releases have much improved the situation.
For this reason, PyGraphviz 1.7 only supports Graphviz 2.46.0 or higher on Windows.
We recommend either manually installing the official binary release of Graphviz or
using `Chocolatey <https://chocolatey.org/>`_, which has been updated to Graphviz 2.46.0.
You may also need to install Visual C/C++, e.g. from here:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Assuming you have Python and Visual C/C++ installed,
we believe the following should work on Windows 10 (64 bit) using PowerShell.
Manual download
~~~~~~~~~~~~~~~
1. Download and install 2.46.0 for Windows 10 (64-bit):
`stable_windows_10_cmake_Release_x64_graphviz-install-2.46.0-win64.exe
<https://gitlab.com/graphviz/graphviz/-/package_files/6164164/download>`_.
2. Install PyGraphviz via
.. code-block:: console
PS C:\> python -m pip install --use-pep517 `
--config-setting="--global-option=build_ext" `
--config-setting="--global-option="-IC:\Program Files\Graphviz\include" `
--config-setting="--global-option="-LC:\Program Files\Graphviz\lib" `
pygraphviz
Chocolatey
~~~~~~~~~~
.. code-block:: console
PS C:\> choco install graphviz
PS C:\> python -m pip install --use-pep517 `
--config-setting="--global-option=build_ext" `
--config-setting="--global-option="-IC:\Program Files\Graphviz\include" `
--config-setting="--global-option="-LC:\Program Files\Graphviz\lib" `
pygraphviz
.. include:: reference/faq.rst