pygraphviz/pygraphviz — pull request #36 by andreabedini (2014-10-31 00:45:15+00:00)
Title: Simplify setup_extra.py

Hey there,

I had some issues installing pygraphviz (even git master) and I ended up refactoring a bit `setup_extra.py`.

1. subprocess was added in python in version 2.4 so I guess we can take it for granted
2. also check_output is handy and the shell doesn't need to be involved
3. to maintain compatibility with python2 we should import `print_function` from the module `__future__` otherwise everything gets printed in parenthesis like it was a tuple.
4. the try...except block is a bit too broad, I had the problem discussed below and it was swallowed by the catch-all except. (I spent 10 minutes trying to find out why I didn't have the graphviz libraries installed, only to discover later that I did have them and the install script had a problem).

my issue was this
```
Traceback (most recent call last):
File "", line 17, in
File "/var/folders/9x/fz874hx56nsbc8h3jlq1vv840000gp/T/pip-Vs2GGu-build/setup.py", line 62, in
include_dirs,library_dirs = pkg_config()
File "setup_extra.py", line 35, in pkg_config
output = output.decode(sys.stdout.encoding)
```

it seems that in python2 and using `pip install .` sys.stdout.encoding is None. Removing that line makes it work for me with both `pip install .` and `pip3 install .`.

So, I need to figure out how to deal correctly with the encoding, there's no need to marge this yet, let me leave it here :)

kudos for working on python3 support!