[ckan-dev] Cannot start CKAN: Import error SOLVED

Timothy Giles timothy.giles at slu.se
Wed Sep 21 08:17:36 UTC 2016


Great job Lucia- added to CKAN favorites!

From: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of lucia.espona at wsl.ch
Sent: den 21 september 2016 10:16
To: CKAN Development Discussions <ckan-dev at lists.okfn.org>
Subject: Re: [ckan-dev] Cannot start CKAN: Import error SOLVED

Thanks for the advice Tim,

I also found this solution for the particular case of branch switching: http://codeinthehole.com/writing/a-useful-git-post-checkout-hook-for-python-repos/

Best,
Lucia
_________________________________________________________
Dr. Lucia Espona Pernas

Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Hauptgebäaude Labortrakt (HL C21)
Zürcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 739 28 71 phone direct
+41 44 739 21 11 reception

www.wsl.ch<http://www.wsl.ch>

-----"ckan-dev" <ckan-dev-bounces at lists.okfn.org<mailto:ckan-dev-bounces at lists.okfn.org>> wrote: -----
To: CKAN Development Discussions <ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>>
From: Tyler Kennedy
Sent by: "ckan-dev"
Date: 19.09.2016 19:13
Subject: Re: [ckan-dev] Cannot start CKAN: Import error SOLVED
Speaking of which, I tend to:

export PYTHONDONTWRITEBYTECODE=true

... in all my development virtualenvs to just disable .pyc files entirely. Between the reloader and everything else, recompiling the bytecode each time is a very small penalty for the quality of life improvement.

On Mon, Sep 19, 2016 at 1:09 PM, <lucia.espona at wsl.ch<mailto:lucia.espona at wsl.ch>> wrote:
Hi Tim

The issue were caused by some .pyc files that are ignored by git and therefore not deleted when switching branches.
I deleted all the .pyc, reinstalled the extensions and now it works as before.

Thanks,
Lucia


_________________________________________________________
Dr. Lucia Espona Pernas

Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Hauptgebäaude Labortrakt (HL C21)
Zürcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 739 28 71<tel:%2B41%2044%20739%2028%2071> phone direct
+41 44 739 21 11<tel:%2B41%2044%20739%2021%2011> reception

www.wsl.ch<http://www.wsl.ch>

-----"ckan-dev" <ckan-dev-bounces at lists.okfn.org<mailto:ckan-dev-bounces at lists.okfn.org>> wrote: -----
To: CKAN Development Discussions <ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>>
From: lucia.espona at wsl.ch<mailto:lucia.espona at wsl.ch>
Sent by: "ckan-dev"
Date: 19.09.2016 18:33
Subject: Re: [ckan-dev] Cannot start CKAN: Import error

Hi Tim

I guess I did not unistall something properly as you said.
I switched to the latest branch, install the new requirements (pip install).
As it didn't work, I switched back to my branch with version 2.5.2 and re-installed the requirements.

Is there something else I can do to get back to my previous state? Is this a problem related to the virtual environment?

Thanks a lot,
Lucia


_________________________________________________________
Dr. Lucia Espona Pernas

Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Hauptgebäaude Labortrakt (HL C21)
Zürcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 739 28 71<tel:%2B41%2044%20739%2028%2071> phone direct
+41 44 739 21 11<tel:%2B41%2044%20739%2021%2011> reception

www.wsl.ch<http://www.wsl.ch>

-----"ckan-dev" <ckan-dev-bounces at lists.okfn.org<mailto:ckan-dev-bounces at lists.okfn.org>> wrote: -----
To: CKAN Development Discussions <ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>>
From: Timothy Giles
Sent by: "ckan-dev"
Date: 19.09.2016 18:18
Subject: Re: [ckan-dev] Cannot start CKAN: Import error

Yes Lucia, Config has changed.



ckan.common.config  is the new config library

pylons.config is the 2.5.2 library



SO looks like you still have some 2.6 / 2.5.3 (?) code/files floating about. Did you actually uninstall or just install on top of the latest branch?



Regards Tim



________________________________
From: ckan-dev <ckan-dev-bounces at lists.okfn.org<mailto:ckan-dev-bounces at lists.okfn.org>> on behalf of lucia.espona at wsl.ch<mailto:lucia.espona at wsl.ch> <lucia.espona at wsl.ch<mailto:lucia.espona at wsl.ch>>
Sent: 19 September 2016 06:02 PM
To: CKAN Development Discussions
Subject: [ckan-dev] Cannot start CKAN: Import error

Dear all

I had a working instance of CKAN v. 2.5.2.
I tried the latest version in the git repository just for testing but it failed so I went back to my 2.5.2 branch.
Now I cannot restart the instance, I installed again the requirements in the virtual environment but I keep getting this ImportError error below.

Does anyone know what can I do?

Thanks a lot,
Lucia

espona at envidat02:/usr/lib/ckan/default/src/ckan$ . /usr/lib/ckan/default/bin/activate
(default) espona at envidat02:/usr/lib/ckan/default/src/ckan$ paster serve /etc/ckan/default/development.ini
Traceback (most recent call last):
  File "/usr/lib/ckan/default/bin/paster", line 11, in <module>
    sys.exit(run())
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 102, 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 141, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
    result = self.command()
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 284, in command
    relative_to=base, global_conf=vars)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 329, in loadapp
    **kw)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 271, in loadobj
    global_conf=global_conf)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 454, in get_context
    section)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use
    object_type, name=use, global_conf=global_conf)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 406, in get_context
    global_conf=global_conf)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 620, in get_context
    object_type, name=name)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 646, in find_egg_entry_point
    possible.append((entry.load(), protocol, entry.name<http://entry.name>))
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2258, in load
    return self.resolve()
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2264, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 10, in <module>
    register your own - be that a set of Shakespeare's works, a global
  File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/flask_app.py", line 6, in <module>
ImportError: cannot import name config

_________________________________________________________
Dr. Lucia Espona Pernas

Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Hauptgebäaude Labortrakt (HL C21)
Zürcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 739 28 71<tel:%2B41%2044%20739%2028%2071> phone direct
+41 44 739 21 11<tel:%2B41%2044%20739%2021%2011> reception

www.wsl.ch<http://www.wsl.ch>
_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160921/54f49392/attachment-0003.html>


More information about the ckan-dev mailing list