2

我无法在 python 中导入 rdflib。错误详细:

Python 2.7.3 (default, Jun 27 2012, 23:48:21) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rdflib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/rdflib/__init__.py", line 65, in <module>
    from rdflib.term import URIRef, BNode, Literal, Variable
  File "/usr/local/lib/python2.7/site-packages/rdflib/term.py", line 49, in <module>
    from isodate import parse_time, parse_date, parse_datetime
ImportError: No module named isodate

如果有人可以提供帮助,我将不胜感激。

谢谢。

4

2 回答 2

5

If you actually install rdflib via pip, then its dependencies will come along with it (isodate included):

pip install -U rdflib

or

easy_install -U rdflib

Chances are you might have installed it directly from source, meaning you would have to take care of the deps yourself.

Information on installing pip if you dont have it already:
http://www.pip-installer.org/en/latest/installing.html

If you have easy_install, you can do: easy_install pip

于 2012-07-02T20:44:55.347 回答
2

似乎存在对isodate的依赖,因此请尝试通过您最喜欢的 PyPI-Installer ( pip oder *easy_install*) 安装它。

于 2012-07-02T20:38:21.753 回答