找不到安装rdflib的路径

时间:2013-02-21 03:25:25

标签: python install rdflib

当我设置时,我得到:

C:\Python27>python Lib\site-packages\rdflib-master\setup.py
Traceback (most recent call last):
    File "Lib\site-packages\rdflib-master\setup.py", line 64, in <module>
        version = find_version('rdflib/__init__.py')
    File "Lib\site-packages\rdflib-master\setup.py", line 59, in find_version
        for line in open(filename):
IOError: [Errno 2] No such file or directory: 'rdflib/__init__.py'

文件在那里,我尝试将包路径添加到PYTHONPATH;没有运气。

所以我尝试使用ez_setup.py,但是在一些网址上窒息了它给它一个404(下面的跟踪)。

我还搜索了一般的安装建议:我找到了pre-K和postgrad,但没有任何帮助我。

Downloading http://cheeseshop.python.org/packages/2.7/s/setuptools/setuptools-0.6c5-py2.7.egg
Traceback (most recent call last):

  File "Lib\site-packages\rdflib-master\ez_setup.py", line 223, in <module>
    main(sys.argv[1:])

  File "Lib\site-packages\rdflib-master\ez_setup.py", line 155, in main
    egg = download_setuptools(version, delay=0)

  File "Lib\site-packages\rdflib-master\ez_setup.py", line 137, in download_setuptools
    src = urllib2.urlopen(url)

  File "C:\Python27\lib\urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)

  File "C:\Python27\lib\urllib2.py", line 400, in open
    response = meth(req, response)

  File "C:\Python27\lib\urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)

  File "C:\Python27\lib\urllib2.py", line 432, in error
    result = self._call_chain(*args)

  File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
    result = func(*args)

  File "C:\Python27\lib\urllib2.py", line 619, in http_error_302
    return self.parent.open(new, timeout=req.timeout)

  File "C:\Python27\lib\urllib2.py", line 400, in open
    response = meth(req, response)

  File "C:\Python27\lib\urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)

  File "C:\Python27\lib\urllib2.py", line 438, in error
    return self._call_chain(*args)

  File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
    result = func(*args)

  File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

2 个答案:

答案 0 :(得分:0)

恐怕我们需要更多信息。哪个版本的RDFLib?如何安装? 我们可以收到完整的错误消息吗?

最好的方法是使用“pip”,以某种方式安装它:http://www.pip-installer.org/en/1.3.X/installing.html

然后再做

pip install rdflib

这将安装最新的RDFLib 3.2.X!

答案 1 :(得分:0)

将源代码放入Lib\site-packages这是一个奇怪的想法,但如果您想从源代码安装,则需要从源目录中调用setup.py。它抱怨rdflib/__init__.py不存在,因为它不存在:请注意路径是相对的。