Win10-64 installing pygraphviz

when you recently deployed a project, the PIP install requirements required a pygraphviz package. This package is for graphical data.
requirements
requirements
requirements
requirements
requirements
requirements
requirements
is the associated error message as shown below.

error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

  ----------------------------------------
  Failed building wheel for pygraphviz
  Running setup.py clean for pygraphviz
Successfully built dominate Flask-Bootstrap flask-nav Flask-Uploads itsdangerous MarkupSafe visitor
Failed to build pygraphviz
Installing collected packages: appdirs, chardet, click, dominate, MarkupSafe, Jinja2, itsdangerous, Werkzeug, Flask, visitor, Flask-Bootstrap, Flask-Login, flask-nav, Flask-Uploads, WTForms, Flask-WTF, gunicorn, iso8601, numpy, pyparsing, six, packaging, pytz, requests, decorator, networkx, graphviz, pygraphviz
  Running setup.py install for pygraphviz ... error
    Complete output from command f:\fiat_dev\venv\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JIANGM~1.FNS\\AppData\\Local\\Temp\\pip-install-b3cfvse8\\pygraphviz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\JIANGM~1.FNS\AppData\Local\Temp\pip-record-h2160l90\install-record.txt --single-version-externally-managed --compile --install-headers f:\fiat_dev\venv\include\site\python3.4\pygraphviz:
	...
    running build_ext
    building 'pygraphviz._graphviz' extension
    error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

    ----------------------------------------
Command "f:\fiat_dev\venv\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JIANGM~1.FNS\\AppData\\Local\\Temp\\pip-install-b3cfvse8\\pygraphviz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\JIANGM~1.FNS\AppData\Local\Temp\pip-record-h2160l90\install-record.txt --single-version-externally-managed --compile --install-headers f:\fiat_dev\venv\include\site\python3.4\pygraphviz" failed with error code 1 in C:\Users\JIANGM~1.FNS\AppData\Local\Temp\pip-install-b3cfvse8\pygraphviz\

in normal fashion, I started Posting this error message to Google. Found some so-called solutions, including pyGraphviz’s Github community, and other blog posts. The solution:
1. Let you install graphviz, then set the environment variable. Then specify at installation time a parameter such as Pip’s inlude path
2. Let you install a 32-bit python, then go to 1, recompile and install pygraphviz
3. Just get out of Windows Binaries for Python Extension Packages.
I’ve tried all of the above solutions. However, when I was compiling, there were a lot of c compilation errors. Format conversion errors and so on. doesn’t solve the real problem . I feel suspicious, these posts on the Net clearly say that doing so can solve ah!

when I received a useful message saying that pygraphviz does not support python3.4 or above . So I reinstalled Python 3.4 and changed the system’s Python environment variable. When I re-installed PIP Install Pygraphviz-xxx-.whl in the CMD, I was notified that the installation was successful.
but for this project I used vitrualenv to manage the packages it needed. I just wrapped this in the system Python library. So I activate the current venv,
and run PIP install pygraphviz-xxx-.whl again, a familiar error message appears:

(venv) F:\pygraphviz-1.3.1>pip install pygraphviz-1.3.1-cp34-none-win_amd64.whl
pygraphviz-1.3.1-cp34-none-win_amd64.whl is not a supported wheel on this platform.
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

wait, didn’t you just install it?What’s the problem?
after some thinking, I found that the virtual python environment built in venv was set up a week ago. At that time, the python version of the system was 3.5.
, so the python version in this virtual environment was also 3.5. So the installation failed. To prove my point, I deleted Venv, re-opened a CMD, and reinstalled a virtual environment.
when I type PIP install pygraphviz-xxx-.whl again, the command line indicates that the installation was successful.

WHL is not a supported wheel on this platform.
is not supported on this platform. WHL is not a supported wheel on this platform. I always thought this meant that this version of the WHL file was not supported by my system version. Now, in retrospect, what it’s really saying is, the Python version doesn’t support, right?

and the last thing to notice is

pygraphviz package can be used on the premise that the software graphviz has been installed on the system, visit the official website to download the installation package, and install it. After installation, add the bin directory to the system path.


to summarize:

  • pygraphviz does not support python3.4 or above,
    when you install this package, try switching to a lower version of python
  • venv the python environment is based on the system python version,
    but after venv is installed, It is to some extent independent of the system python
  • is not a supported wheel on this platform
    platform is not only the operating system platform, but also the development environment, etc.

is also attached to install pygraphviz may useful connection :

  • installation steps in detail reference post: https://blog.csdn.net/churximi/article/details/51059285

  • Unofficial Windows Binaries for Python Extension Packages

    and finally, good luck ~

Read More: