1

安装了juju的所有依赖项

pip install pyparsing==1.5.7
pip install pyOpenSSL PyYAML txaws pydot oauth txzookeeper zc-zookeeper-static
pip install juju

所有安装都很好,但是当我开始时juju,失败并出现以下错误:

(jujuapp) ± juju                                                                                           
Traceback (most recent call last):
  File "/Users/millisami/.virtualenvs/jujuapp/bin/juju", line 4, in <module>
    from juju.control import main
  File "/Users/millisami/.virtualenvs/jujuapp/lib/python2.7/site-packages/juju/control/__init__.py", line 7, in <module>
    from .utils import ParseError
  File "/Users/millisami/.virtualenvs/jujuapp/lib/python2.7/site-packages/juju/control/utils.py", line 8, in <module>
    from juju.state.environment import EnvironmentStateManager
  File "/Users/millisami/.virtualenvs/jujuapp/lib/python2.7/site-packages/juju/state/environment.py", line 8, in <module>
    from juju.environment.config import EnvironmentsConfig
  File "/Users/millisami/.virtualenvs/jujuapp/lib/python2.7/site-packages/juju/environment/config.py", line 8, in <module>
    from juju.lib import serializer
  File "/Users/millisami/.virtualenvs/jujuapp/lib/python2.7/site-packages/juju/lib/serializer.py", line 1, in <module>
    from yaml import CSafeLoader, CSafeDumper, Mark
ImportError: cannot import name CSafeLoader

这是什么错误?我在 Mac 10.6 上,通过自制软件安装了 python 和 pip。

4

1 回答 1

3

我刚刚在 10.8 遇到了这个问题;juju 使用 PyYaml 中的 libyaml 绑定,所以它需要安装 PyYaml --with-libyaml,这比 mac 上需要更多。这是我如何让它工作的:

  • brew install libyaml自制
  • 下载 PyYaml 源码(说明

现在修改[pyyaml-install-dir]/setup.cfg如下:

# List of directories to search for 'yaml.h' (separated by ':').
include_dirs=/usr/local/Cellar/libyaml/0.1.4/include/

# List of directories to search for 'libyaml.a' (separated by ':').
library_dirs=/usr/local/Cellar/libyaml/0.1.4/lib/

所以它可以找到你的 libyaml 的自制安装。然后你还需要安装Cython..

  • sudo pip install cython

最后..

  • sudo python setup.py --with-libyaml install(在 PyYaml 目录中)

现在juju应该可以工作了!

于 2013-03-26T03:41:45.130 回答