8

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
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Kamrul Khan
  • 3,260
  • 4
  • 32
  • 59

5 Answers5

11
  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

Benny
  • 4,095
  • 1
  • 26
  • 27
  • 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.` – Manu Chadha May 13 '19 at 04:55
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
yu yang Jian
  • 6,680
  • 7
  • 55
  • 80
1

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.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
  • I tried that... says python version 3.4 required which was not found in yur registry. I am running python 3.5 – Kamrul Khan Nov 12 '15 at 06:04
  • 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. – Burhan Khalid Nov 12 '15 at 06:35
  • so ill have to downgrade my python? is there any other way ? – Kamrul Khan Nov 12 '15 at 06:56
  • 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](http://pyyaml.org/wiki/PyYAML) for updates on when Python 3.5 will be supported. – Burhan Khalid Nov 12 '15 at 07:02
  • 1
    You can find pyYAML binaries for Python 3.5 at http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyyaml. All tests pass. – cgohlke Nov 12 '15 at 07:39
1

just run:

pip install PyYAML==5.3.1

in powershell

Lucas Videcoq
  • 11
  • 1
  • 1
0

Download suitable(Python version, 32/64 bit) .exe file from http://pyyaml.org/wiki/PyYAML, then double click it to install PyYAML to your Windows 10 PC following the wizard window.

Jon Jiang
  • 51
  • 6