[ckan-dev] No module named common

Dave Caraway dave at fogmine.com
Thu Aug 29 01:26:36 UTC 2013


Hi Edo,

With your virtualenv activated, are you able to import the module from
interactive python session?

1.) python
2.) >>> from ckan.common import json

If you get an import error still, that means that ckan isn't installed
corredctly in your virtual environment. You might want to reinstall ckan.
>From your src being inside your virtualenv, I believe you installed using
the pip +e option. you can run 'python setup.py develop' from within your
ckan source. you might also consider a git clone of the repo and install
from that (again using 'python setup.py develop')

If you do not get an import error, the problem may be in just how your
launching. Paster has to run from the root of the project src (which it
looks like your doing), but an easy way to test is to just run the command
'paster' with no args and see that there are a number of CKAN options
available (celeryd, color, db, less, sysadmin...).

-Dave


On Tue, Aug 27, 2013 at 7:17 PM, Eduardo Bejar <wonka at fundapi.org> wrote:

> >Did you create and activate (i.e. source) your
> >virtualenv with the following command?
> >. /usr/lib/ckan/default/bin/activate
>
> Yes, here's what I did:
>
> cd /usr/lib/ckan/default/src/ckan/
> . /usr/lib/ckan/default/bin/actívate
> (default) $ sudo paster db init -c /etc/ckan/default/development.ini
>
> And here's the traceback:
>
> Traceback (most recent call last):
>   File "/usr/bin/paster", line 4, in <module>
>     command.run()
>   File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line
> 104,
> in run
>     invoke(command, command_name, options, args[1:])
>   File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line
> 143,
> in invoke
>     exit_code = runner.run(args)
>   File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line
> 238,
> in run
>     result = self.command()
>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 124, in
> command
>     self._load_config()
>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 86, in
> _load_config
>     load_environment(conf.global_conf, conf.local_conf)
>   File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line
> 135, in load_environment
>     p.load_all(config)
>   File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 95, in
> load_all
>     find_user_plugins(config)
>   File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 178, in
> find_user_plugins
>     plugins.extend(ep.load() for ep in entry_points)
>   File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 178, in
> <genexpr>
>     plugins.extend(ep.load() for ep in entry_points)
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in
> load
>     entry = __import__(self.module_name, globals(),globals(), ['__name__'])
>   File "/home/web/src/ckan/ckanext/textpreview/plugin.py", line 5, in
> <module>
>     from ckan.common import json
> ImportError: No module named common
>
> Any other idea? Thanks,
>
> Edo
>
> ---
>
> De: ckan-dev-bounces at lists.okfn.org [mailto:
> ckan-dev-bounces at lists.okfn.org]
> En nombre de Stefan Oderbolz
> Enviado el: martes, 27 de agosto de 2013 16:16
> Para: CKAN Development Discussions
> Asunto: Re: [ckan-dev] No module named common
>
> Did you create and activate (i.e. source) your virtualenv with the
> following
> command?
>
> . /usr/lib/ckan/default/bin/activate
>
> your command prompt should change to something like "(default)$"
>
> On Tue, Aug 27, 2013 at 9:42 PM, Eduardo Bejar <wonka at fundapi.org> wrote:
> Hello,
>
> Continuing installing CKAN 2.2 on an clean install Ubuntu 12.04 64-bit
> server. Following the Install from source guide
> (http://docs.ckan.org/sv/latest/install-from-source.html), now when I try
> step 6:
>
> paster db init -c /etc/ckan/default/development.ini
>
> I get:
>
> ImportError: No module named common
>
> Any ideas about what should I try? Previously this line gave me a
> json_preview error which I solved with your suggestions about changing it
> to
> text_preview.
>
> Thank you for your comments,
>
> Edo
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>
>
>
> --
> Liip AG  //  Feldstrasse 133 //  CH-8004 Zurich
> Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>



-- 
Dave Caraway
Owner
Fog Mine
dave at fogmine.com
Cell: (937) 985-0867
Fax: (866) 238-3120
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130828/39058396/attachment-0001.html>


More information about the ckan-dev mailing list