使用 Easy_install 安装 Gaphor,使用 MacPorts 安装其依赖项

使用 Easy_install 安装 Gaphor,使用 MacPorts 安装其依赖项

我似乎通过 Easy_install 成功安装了 Gaphor

$ sudo easy_install gaphor
Searching for gaphor
Best match: gaphor 0.14.0
Processing gaphor-0.14.0-py2.5.egg
gaphor 0.14.0 is already the active version in easy-install.pth
Installing gaphorconvert script to /usr/local/bin
Installing gaphor script to /usr/local/bin

Using /Library/Python/2.5/site-packages/gaphor-0.14.0-py2.5.egg
Processing dependencies for gaphor
Finished processing dependencies for gaphor

我运行它失败了

$ gaphor
Traceback (most recent call last):
  File "/usr/local/bin/gaphor", line 8, in <module>    load_entry_point('gaphor==0.14.0', 'console_scripts', 'gaphor')()
  File "/Library/Python/2.5/site-packages/gaphor-0.14.0-py2.5.egg/gaphor/__init__.py", line 65, in main    launch()
  File "/Library/Python/2.5/site-packages/gaphor-0.14.0-py2.5.egg/gaphor/__init__.py", line 36, in launch    from gaphor.application import Application
  File "/Library/Python/2.5/site-packages/gaphor-0.14.0-py2.5.egg/gaphor/application.py", line 16, in <module>    import gaphor.UML
  File "/Library/Python/2.5/site-packages/gaphor-0.14.0-py2.5.egg/gaphor/UML/__init__.py", line 3, in <module>
    from gaphor.UML.uml2 import *
  File "/Library/Python/2.5/site-packages/gaphor-0.14.0-py2.5.egg/gaphor/UML/uml2.py", line 97, in <module>
    from diagram import Diagram
  File "/Library/Python/2.5/site-packages/gaphor-0.14.0-py2.5.egg/gaphor/UML/diagram.py", line 12, in <module>    import gobject
ImportError: No module named gobject

然后我安装 gobject 并运行sudo port install py26-gobject。但是,同样的问题仍然存在。

如何通过 MacPorts 将 Gaphor 安装到 OS X?

答案1

您缺少适用于 Python 2.5 的 GObject。

跑步:

sudo port install py25-gobject

此后,Gaphor 应该可以工作。

答案2

您不是使用 MacPorts 安装的,而是使用系统 Python 安装进行的安装。

相反,尝试

sudo /opt/local/bin/easy_install gaphor

正如 Mike 所说,你可能需要使用 macports 安装支持库

相关内容