Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ImportError: No module named pika" when starting the gather_consumer #125

Closed
opensas opened this issue Jan 27, 2015 · 4 comments
Closed

Comments

@opensas
Copy link

opensas commented Jan 27, 2015

I followed the guide at https://github.com/ckan/ckanext-harvest/blob/master/README.rst

I had to install the plugin and the requirement with sudo because of permission to write to /usr/lib/ckan/default/src/ckan/src/ckanext-harvest

When I start the gather_consumer, I get the following error:

(default)ckan@ckan1:/usr/lib/ckan/default/src/ckanext-harvest$ paster --plugin=ckanext-harvest harvester gather_consumer --config=/etc/ckan/default/production.ini 
2015-01-27 15:22:11,241 DEBUG [ckanext.harvest.model] Harvest tables defined in memory
2015-01-27 15:22:11,244 DEBUG [ckanext.harvest.model] Harvest tables already exist
2015-01-27 15:22:11,279 DEBUG [ckanext.harvest.plugin] No auth module for action "update"

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/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/ckanext-harvest/ckanext/harvest/queue.py", line 5, in <module>
    import pika
ImportError: No module named pika

I could solve it login in as root with sudo su

$ sudo su
root@ckan1:/# . /usr/lib/ckan/default/bin/activate
(default)root@ckan1:/# cd /usr/lib/ckan/default/src/ckanext-harvest/
(default)root@ckan1:/usr/lib/ckan/default/src/ckanext-harvest# pip install -r pip-requirements.txt

Requirement already satisfied (use --upgrade to upgrade): pika==0.9.8 in /usr/lib/ckan/default/lib/python2.7/site-packages (from -r pip-requirements.txt (line 1))

Requirement already satisfied (use --upgrade to upgrade): redis==2.10.1 in /usr/lib/ckan/default/lib/python2.7/site-packages (from -r pip-requirements.txt (line 2))
Cleaning up...

(default)root@ckan1:/usr/lib/ckan/default/src/ckanext-harvest# paster --plugin=ckanext-harvest harvester gather_consumer --config=/etc/ckan/default/production.ini 

2015-01-27 15:29:56,728 DEBUG [ckanext.harvest.queue] Gather queue consumer registered

I guess I must be doing something wrong when installing the dependencies with sudo. If anubody can point in the right direction I can help updating the install documentation.

@opensas
Copy link
Author

opensas commented Jan 27, 2015

Sorry, after installing requirements as root everything seems to work fine... I can run all the commands as a regular user. Perhaps we could update the docs to state this...

@davidread
Copy link
Contributor

You shouldn't need sudo to do pip installs. Are you running ckan from source or package? Did you run this line from the docs:

sudo chown `whoami` /usr/lib/ckan/default

http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html

@opensas
Copy link
Author

opensas commented Jan 27, 2015

I installed from package, so I missed the chown, I guess that explains it
all, I'll give it a try and then I'll tell you

On Tue, Jan 27, 2015 at 6:52 PM, David Read notifications@github.com
wrote:

You shouldn't need sudo to do pip installs. Are you running ckan from
source or package? Did you run this line from the docs:

sudo chown whoami /usr/lib/ckan/default

http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html


Reply to this email directly or view it on GitHub
#125 (comment)
.

@rossjones
Copy link
Contributor

@opensas did this solve your issue? I'd like to close the issue if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants