Conceptnet5 python安装程序m

2024-09-27 00:18:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在mac上本地安装conceptnet。在

我采用了高带宽、低计算量的方法https://github.com/commonsense/conceptnet5/wiki/Running-your-own-copy并执行了以下操作:

git clone https://github.com/commonsense/conceptnet5
pyvenv-3.4 conceptnet-env
source conceptnet-env/bin/activate
cd conceptnet5
python setup.py develop
make download_db

在最后一步,我得到了以下错误:

命令

^{pr2}$

输出

readlink: illegal option -- f
usage: readlink [-n] [file ...]

所以我忽略了这一步,因为我看到了一个google讨论,它提出了另一种方法(因为link命令对我不起作用)

因此,在这次讨论中,https://github.com/commonsense/conceptnet5/issues/33我尝试了以下方法:

CONCEPTNET_DATA=~/conceptnet5/data/
export CONCEPTNET_DATA

但这并不奏效,因为在执行以下操作时:

from conceptnet5.query import lookup
lookup('/c/en/examples')

我得到以下错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/arj/Desktop/app/conceptnet5/conceptnet5/query.py", line 75, in lookup
    self.load_index()
  File "/Users/arj/Desktop/app/conceptnet5/conceptnet5/query.py", line 58, in load_index
    self._db_filename, self._edge_dir, self.nshards
  File "/Users/arj/Desktop/app/conceptnet5/conceptnet5/formats/sql.py", line 211, in __init__
    self._connect()
  File "/Users/arj/Desktop/app/conceptnet5/conceptnet5/formats/sql.py", line 216, in _connect
    self.dbs[i] = sqlite3.connect(filename)
sqlite3.OperationalError: unable to open database file

ln命令的操作系统等价物是什么?在

或者,我还能为conceptnet找到数据库文件做些什么呢?在


Tags: 方法inpyhttpsselfgithubcomapp

热门问题