Python – How to install pyYAML on windows 10

pythonpyyamlwindows

Im trying to install pyYAML from source on windows 10. I downloaded PyYAML 3.11 from https://pypi.python.org/pypi/PyYAML. When I run setup.py I get error: [WinError 2] The system cannot find the file specified. How to fix it?

PyYAML-3.11>python setup.py install
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\yaml
copying lib3\yaml\composer.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\constructor.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\cyaml.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\dumper.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\emitter.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\error.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\events.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\loader.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\nodes.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\parser.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\reader.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\representer.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\resolver.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\scanner.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\serializer.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\tokens.py -> build\lib.win-amd64-3.5\yaml
copying lib3\yaml\__init__.py -> build\lib.win-amd64-3.5\yaml
running build_ext
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
checking if libyaml is compilable
error: [WinError 2] The system cannot find the file specified

Best Answer

  1. Download the wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyyaml that suits your need (Python version, 32/64 bit).

  2. $ pip3 install PyYAML-3.11-cp35-none-win32.whl