Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Plugins ckan收割机:“;没有名为“pika”的模块;错误_Plugins_Ckan_Data Harvest - Fatal编程技术网

Plugins ckan收割机:“;没有名为“pika”的模块;错误

Plugins ckan收割机:“;没有名为“pika”的模块;错误,plugins,ckan,data-harvest,Plugins,Ckan,Data Harvest,在运行ok的ckan实例上,我按照以下指南安装了harvester扩展: 以下是我遵循的步骤: . /usr/lib/ckan/default/bin/activate cd /usr/lib/ckan/default/src/ckan sudo pip install -e git+https://github.com/okfn/ckanext-harvest.git@stable#egg=ckanext-harvest cd /usr/lib/ckan/default/src/ckan/

在运行ok的ckan实例上,我按照以下指南安装了harvester扩展:

以下是我遵循的步骤:

. /usr/lib/ckan/default/bin/activate
cd /usr/lib/ckan/default/src/ckan

sudo pip install -e git+https://github.com/okfn/ckanext-harvest.git@stable#egg=ckanext-harvest

cd /usr/lib/ckan/default/src/ckan/src/ckanext-harvest
sudo pip install -r pip-requirements.txt
这是pip-requirements.txt的内容:

pika==0.9.8
redis==2.10.1
我继续配置插件,一切正常。我有它在运行。然后,我创建了一个新的源,当我想要启动“聚集”命令时,我得到以下错误:

$ . /usr/lib/ckan/default/bin/activate
$ cd /usr/lib/ckan/default/src/ckan/src/ckanext-harvest
$ paster --plugin=ckanext-harvest harvester gather_consumer --config=/etc/ckan/default/production.ini 

Traceback (most recent call last):
  File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
    load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/lib/ckan/default/src/ckan/src/ckanext-harvest/ckanext/harvest/commands/harvester.py", line 125, in command
    from ckanext.harvest.queue import get_gather_consumer, gather_callback
  File "/usr/lib/ckan/default/src/ckan/src/ckanext-harvest/ckanext/harvest/queue.py", line 5, in <module>
    import pika
ImportError: No module named pika
$/usr/lib/ckan/default/bin/activate
$cd/usr/lib/ckan/default/src/ckan/src/ckanext
$paster--plugin=ckanext harvest harvester gather_consumer--config=/etc/ckan/default/production.ini
回溯(最近一次呼叫最后一次):
文件“/usr/lib/ckan/default/bin/paster”,第9行,在
加载输入点('PasteScript==1.7.5','console_脚本','paster')()
文件“/usr/lib/ckan/default/local/lib/python2.7/site packages/paste/script/command.py”,第104行,正在运行
调用(命令、命令名、选项、参数[1:])
文件“/usr/lib/ckan/default/local/lib/python2.7/site packages/paste/script/command.py”,第143行,在invoke中
退出代码=runner.run(args)
文件“/usr/lib/ckan/default/local/lib/python2.7/site packages/paste/script/command.py”,第238行,正在运行
结果=self.command()
文件“/usr/lib/ckan/default/src/ckan/src/ckanext-harvest/ckanext/harvest/commands/harvester.py”,命令中第125行
从ckanext.harvest.queue导入获取\u聚集\u消费者,聚集\u回调
文件“/usr/lib/ckan/default/src/ckan/src/ckanext-harvest/ckanext/harvest/queue.py”,第5行,在
进口鼠兔
ImportError:没有名为pika的模块

我很确定virtualenv(这里的python新手)一定有一些非常愚蠢的地方

这是因为您使用了
sudopip
。由于python的virtualenv的工作方式,如果您想使用
sudo
安装到virtualenv中,您需要提供
pip
的完整路径。像这样的东西会有用的

sudo /usr/lib/ckan/default/bin/pip -e git+https://github.com/okfn/ckanext-harvest.git@stable#egg=ckanext-harvest
cd /usr/lib/ckan/default/src/ckanext-harvest
sudo /usr/lib/ckan/default/bin/pip install -r pip-requirements.txt