0

尝试通过在 /opt/opscenter-5.1.0/bin 中运行 ./opscenter 在 Ubuntu 14.04 64 位上启动 OpsCenter 5.1.0 的 tarball 安装失败,并出现以下错误:

Traceback (most recent call last): File "./bin/twistd", line 28, in <module> from twisted.scripts.twistd import run ImportError: cannot import name run

我的python版本是2.7.6:
$ python --version Python 2.7.6

并尝试导入扭曲的结果:
$ python -c "import twisted; print twisted" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named twisted

opscenter 中 PYTHONPATH 的值如下所示:
PYTHONPATH: ./src:/usr/lib/python2.7/site-packages:./src/lib/python2.7/site-packages:./lib/python2.7/site-packages:./lib/py:./lib/py-debian/2.7/amd64::

这里出了什么问题,有人可以建议一个值得尝试 Python 新手的解决方法吗?

4

1 回答 1

1

问题是由于捆绑的 python 库之间缺少符号链接。特别是,在 /lib/py-debian/2.7/amd64/twisted 文件 _version.py、plugin.py、init .py 和 copyright.py 的 py-unpure 目录内容的符号链接丢失。

最初,我使用 tarTree 中的 gradle 副本来提取存档,导致缺少符号链接。改用 tar -xzf 可以解决问题,并且 opscenter 按预期启动。

于 2015-03-31T09:06:03.043 回答