problems with rdflib

2011-12-06
2013-03-15
  • Will Emmerson

    Will Emmerson - 2011-12-06

    I can't get rdflib to work in pydev. I can import rdflib but not rdflib.graph which is needed to run the examples. It works fine from IDLE or command line. Also, I tried another library (PIL) in pydev and that worked fine. I've tried expanding the egg file in site-packages, doesn't work. I'm using latest version of everything. Any ideas?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-12-06

    Which error are you having exactly (i.e.: is it only in code-analysis or are you getting an error when you run? Can you give details on it?)

    It'd also be nice if you could post the PYTHONPATH you have (both from the command line and from within Eclipse):

    import sys
    print('\n'.join(sorted(sys.path)))

    Cheers,

    Fabio

     
  • Will Emmerson

    Will Emmerson - 2011-12-06

    Hi, the code I am trying to execute is:

    from rdflib.graph import Graph
    

    The error I get is:

    Traceback (most recent call last):
      File "D:\Dropbox\workspace\pyNLG\src\rdflib.py", line 15, in <module>
        from rdflib.graph import Graph
      File "D:\Dropbox\workspace\pyNLG\src\rdflib.py", line 15, in <module>
        from rdflib.graph import Graph
    ImportError: No module named graph
    

    The pythonpath in eclipse is:

    C:\Windows\system32\python27.zip
    D:\Dropbox\workspace\pyNLG
    D:\Dropbox\workspace\pyNLG\src
    D:\Dropbox\workspace\pyNLG\src
    D:\Python27\Lib\site-packages\rdflib
    D:\python27
    D:\python27\DLLs
    D:\python27\lib
    D:\python27\lib\lib-tk
    D:\python27\lib\plat-win
    D:\python27\lib\site-packages
    D:\python27\lib\site-packages\pil-1.1.7-py2.7-win32.egg
    D:\python27\lib\site-packages\pyparsing-1.5.6-py2.7-win32.egg
    D:\python27\lib\site-packages\rdfextras-0.1-py2.7.egg
    D:\python27\lib\site-packages\simplejson-2.2.1-py2.7.egg
    D:\python27\lib\site-packages\sparqlwrapper-1.4.2-py2.7.egg
    

    The pythonpath from commandline is:

    C:\Windows\system32\python27.zip
    D:\python27
    D:\python27\DLLs
    D:\python27\lib
    D:\python27\lib\lib-tk
    D:\python27\lib\plat-win
    D:\python27\lib\site-packages
    D:\python27\lib\site-packages\pil-1.1.7-py2.7-win32.egg
    D:\python27\lib\site-packages\pyparsing-1.5.6-py2.7-win32.egg
    D:\python27\lib\site-packages\rdfextras-0.1-py2.7.egg
    D:\python27\lib\site-packages\simplejson-2.2.1-py2.7.egg
    D:\python27\lib\site-packages\sparqlwrapper-1.4.2-py2.7.egg
    
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-12-06

    The problem is that your main module is called 'rdflib' (so, when you import rdflib you're importing your module and not the one in the system).

    So, renaming D:\Dropbox\workspace\pyNLG\src\rdflib.py to something else (i.e.: D:\Dropbox\workspace\pyNLG\src\rdflib_test.py) should make it work properly in your system.

    Cheers,

    Fabio

     
  • Will Emmerson

    Will Emmerson - 2011-12-06

    Oh dear. I feel very stupid. Thanks!

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks