如何安装适用于Python的yaml软件包? [英] How do I install the yaml package for Python?
问题描述
我有一个使用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,还可以使用包管理器,例如aptitude
或yum
:
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屋!