How do I install the yaml package for Python?
Use the search feature in pip,
$ pip search yaml
which appearance for packages in PyPI with yaml within the short description. That reveals numerous packages, together with PyYaml, yamltools, and PySyck, among others (Note that PySyck docs advocate exploitation PyYaml, since syck is out of date). currently you recognize a particular package name, you’ll be able to install it:
$ pip install pyyaml
For Install python yaml system-wide in linux,Using the package manager, like aptitude or yum will give the desired result:
$ sudo apt-get install python-yaml $ sudo yum install python-yaml
Try this code:
pip install pyyaml
The alternative solution for not having pip, run the easy_install pip to install pip, which is the go-to package installer – Why use pip over easy_install?. Those who prefer to stick with easy_install, then easy_install pyyaml .
For MacOSX (mavericks), The subsequent looks to work:
brew install libyaml sudo python -m easy_install pyyaml