How do I install the yaml package for Python?

2019-01-10 02:16发布

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)

8条回答
等我变得足够好
2楼-- · 2019-01-10 02:53

Debian-based systems:

$ sudo aptitude install python-yaml

or newer for python3

$ sudo aptitude install python3-yaml

查看更多
女痞
3楼-- · 2019-01-10 02:57

For MacOSX (mavericks), the following seems to work:

brew install libyaml
sudo python -m easy_install pyyaml
查看更多
登录 后发表回答