Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install the yaml package for Python?

I have a Python program that uses YAML. I attempted to install it on a new server using pip install yaml and it returns the following:

$ sudo pip install yaml Downloading/unpacking yaml   Could not find any downloads that satisfy the requirement yaml No distributions at all found for yaml Storing complete log in /home/pa/.pip/pip.log 

How do I install the yaml package for Python? I'm running Python 2.7. (OS: Debian Wheezy)

like image 991
harperville Avatar asked Jan 10 '13 15:01

harperville


People also ask

Does YAML come with Python?

YAML format YAML natively supports three basic data types: scalars (such as strings, integers, and floats), lists, and associative arrays. The official recommended filename extension for YAML files has been . yaml . There are two modules in Python for YAML: PyYAML and ruamel.


2 Answers

You could try the search feature in pip,

$ pip search yaml 

which looks for packages in PyPI with yaml in the short description. That reveals various packages, including PyYaml, yamltools, and PySyck, among others (Note that PySyck docs recommend using PyYaml, since syck is out of date). Now you know a specific package name, you can install it:

$ pip install pyyaml 

If you want to install python yaml system-wide in linux, you can also use a package manager, like aptitude or yum:

$ sudo apt-get install python-yaml $ sudo yum install python-yaml 
like image 162
Bonlenfum Avatar answered Sep 24 '22 02:09

Bonlenfum


pip install pyyaml

If you don't have pip, run easy_install pip to install pip, which is the go-to package installer - Why use pip over easy_install?. If you prefer to stick with easy_install, then easy_install pyyaml

like image 22
harperville Avatar answered Sep 25 '22 02:09

harperville