How to install pyYAML on windows 10

27,137

Solution 1

  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

Solution 2

I install PyYAML following these steps:

  1. clone or download https://github.com/yaml/pyyaml
  2. open cmd and cd to the downloaded path
  3. execute python setup.py install as README in the repo says

Solution 3

You will need to install many dependencies to get a proper build environment setup in Windows.

To make your life easy, there are use the windows installers (the .exe files) that correspond to your version of Python (so if you have installed 32 bit Python on 64bit Windows, use the 32bit installers).

The installers are listed on the PyPi index page for PyYAML.

The only drawback is that these installers will not work correct in a virtual environment, so you'll have to install them against the base version of Python.

Solution 4

just run:

pip install PyYAML==5.3.1

in powershell

Share:
27,137
Kamrul Khan
Author by

Kamrul Khan

Updated on June 23, 2020

Comments

  • Kamrul Khan
    Kamrul Khan almost 4 years

    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
    
  • Kamrul Khan
    Kamrul Khan over 8 years
    I tried that... says python version 3.4 required which was not found in yur registry. I am running python 3.5
  • Burhan Khalid
    Burhan Khalid over 8 years
    Python 3.5 is not supported; you can see that builds are provided for Python 3.4, and officially only 3.2 is listed as compatible.
  • Kamrul Khan
    Kamrul Khan over 8 years
    so ill have to downgrade my python? is there any other way ?
  • Burhan Khalid
    Burhan Khalid over 8 years
    I'm afraid not, as even if you were to compile and build it against 3.5; as it is not officially supported with Python 3.5; you may have issues. You can check the official wiki for updates on when Python 3.5 will be supported.
  • cgohlke
    cgohlke over 8 years
    You can find pyYAML binaries for Python 3.5 at lfd.uci.edu/~gohlke/pythonlibs/#pyyaml. All tests pass.
  • Muhammad Muazzam
    Muhammad Muazzam about 7 years
    Please be specific to question
  • Jon Jiang
    Jon Jiang about 6 years
    Just double click the .exe file, and flow the guide window, very simple.
  • Manu Chadha
    Manu Chadha about 5 years
    I am on win64 but I don't see any win64 option. I tried win_amd64 option but I get error ERROR: PyYAML-5.1-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.