我有一个使用 YAML 的 Python 程序。我尝试使用 pip install yaml
在新服务器上安装它,它返回以下内容:
$ 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)
最佳答案
你可以试试pip的搜索功能,
$ pip search yaml
在简短描述中使用 yaml 在 PyPI 中查找包。这揭示了各种包,包括 PyYaml、yamltools 和 PySyck 等(注意 PySyck docs 建议使用 PyYaml,因为 syck 已过时)。现在你知道了一个特定的包名,你可以安装它:
$ pip install pyyaml
如果你想在 linux 系统范围内安装 python yaml,你也可以使用包管理器,如 aptitude
或 yum
:
$ sudo apt-get install python-yaml
$ sudo yum install python-yaml
关于python - 如何为 Python 安装 yaml 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14261614/