如何安装适用于Python的yaml软件包? [英] How do I install the yaml package for Python?

查看:356
本文介绍了如何安装适用于Python的yaml软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用YAML的Python程序.我尝试使用pip install yaml将其安装在新服务器上,并且返回以下内容:

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

如何为Python安装yaml软件包?我正在运行Python 2.7. (操作系统:Debian Wheezy)

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

推荐答案

您可以尝试点子搜索功能

You could try the search feature in pip,

$ pip search yaml

会在简短说明中使用yaml在PyPI中查找软件包.这揭示了各种软件包,包括PyYaml,yamltools和PySyck等(请注意, PySyck文档建议使用PyYaml ,因为syck已过期).现在您知道了特定的软件包名称,可以安装它:

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

如果要在linux系统范围内安装python yaml,还可以使用包管理器,例如aptitudeyum:

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

这篇关于如何安装适用于Python的yaml软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆