我有一个使用YAML的Python程序.我try 使用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包?我正在运行Python2.7.(操作系统:Debian Wheezy)

推荐答案

你可以试试pip的搜索功能,

$ pip search yaml

它在简短描述中使用YAML查找PyPI中的包.这揭示了各种包,包括PyYaml、yamltools和PySyck等(请注意,PySyck docs人建议使用PyYaml,因为syck已经过时).现在您知道了特定的软件包名称,可以安装它了:

$ pip install pyyaml

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

$ sudo apt-get install python-yaml
$ sudo yum install python-yaml

Python相关问答推荐

用ctype构建指针链

使用decorator 自动继承父类

从 struct 类型创建MultiPolygon对象,并使用Polars列出[list[f64]列

了解shuffle在NP.random.Generator.choice()中的作用

Tkinter -控制调色板的位置

Twilio:CallInstance对象没有来自_的属性'

如何使用bs 4从元素中提取文本

过滤绕轴旋转的螺旋桨

当值是一个integer时,在Python中使用JMESPath来验证字典中的值(例如:1)

jit JAX函数中的迭代器

优化在numpy数组中非零值周围创建缓冲区的函数的性能

线性模型PanelOLS和statmodels OLS之间的区别

Deliveryter Notebook -无法在for循环中更新matplotlib情节(保留之前的情节),也无法使用动画子功能对情节进行动画

将整组数组拆分为最小值与最大值之和的子数组

PywinAuto在Windows 11上引发了Memory错误,但在Windows 10上未引发

ODE集成中如何终止solve_ivp的无限运行

numpy卷积与有效

PyQt5,如何使每个对象的 colored颜色 不同?'

基于形状而非距离的两个numpy数组相似性

在matplotlib中使用不同大小的标记顶部添加批注