ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • ImportError: No module named simplecrypt
    HOWTO 2020. 6. 25. 10:20

    ckan 을 활용해 데이터 카탈로그를 관리하기 위해 ckanext-harvest 를 설치하고 있는데 가이드대로 잘 되지가 않는다. ㅠㅠ

    ImportError: No module named simplecrypt 에러 발생하면서 종료 흑흑

    paster --plugin=ckanext-harvest harvester initdb --config=/etc/ckan/default/production.ini

    Traceback (most recent call last):

    File "/usr/lib/ckan/default/bin/paster", line 8, in <module> 

    sys.exit(run())

    File "/usr/lib/ckan/default/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/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke

    exit_code = runner.run(args)

    File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/command.py", line 236, in run

    result = self.command()

    File "/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/commands/harvester.py", line 166, in command

    self._load_config()

    File "/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/commands/harvester.py", line 229, in _load_config

    super(Harvester, self)._load_config()

    File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 330, in _load_config

    self.site_user = load_config(self.options.config, load_site_user)

    File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 237, in load_config

    load_environment(conf.global_conf, conf.local_conf)

    File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 116, in load_environment

    p.load_all()

    File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 140, in load_all

    load(*plugins)

    File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 154, in load

    service = _get_service(plugin)

    File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 256, in _get_service

    return plugin.load()(name=plugin_name)

    File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources/init.py", line 2305, in load

    return self.resolve()

    File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources/init.py", line 2311, in resolve

    module = import(self.module_name, fromlist=['name'], level=0)

    File "/usr/lib/ckan/default/src/ckanext-dataproxy/ckanext/dataproxy/plugin.py", line 4, in <module> 

    from ckanext.dataproxy.logic.action.create import dataproxy_resource_create

    File "/usr/lib/ckan/default/src/ckanext-dataproxy/ckanext/dataproxy/logic/action/create.py", line 3, in <module> 

    from simplecrypt import encrypt

    ImportError: No module named simplecrypt

    찾아보니 simplecrypt 가 없어서 발생하는 에러라고 한다. 

    simplecrypt를 설치하면 되는데 simple-crypt 로 설치해야 되는건 함정 

    # pip install simple-crypt

    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

    Processing /root/.cache/pip/wheels/da/18/8d/5b0bc872d10ac287c46543e49480ec771b3d6b69fb9e483364/simple_crypt-4.1.7-py2-none-any.whl

    Processing /root/.cache/pip/wheels/b6/e6/c8/d1eca13628952ceec1d40d96e0a7a1380460d2349ce0b85312/pycrypto-2.6.1-cp27-cp27mu-linux_x86_64.whl

    Installing collected packages: pycrypto, simple-crypt

    Successfully installed pycrypto-2.6.1 simple-crypt-4.1.7

    이후에 ckanext-harvest 를 적용하면 정상적으로 완료된다. 

    # paster --plugin=ckanext-harvest harvester initdb --config=/etc/ckan/default/production.ini

    2020-06-25 10:08:27,443 DEBUG [ckanext.harvest.model] Harvest tables defined in memory

    2020-06-25 10:08:27,452 DEBUG [ckanext.harvest.model] Harvest tables already exist

    2020-06-25 10:08:27,729 DEBUG [ckanext.harvest.model] Harvest tables already exist

     

    2020-06-25 10:08:27,926 DEBUG [ckanext.harvest.model] Harvest tables already exist

    DB tables created

     

    반응형

    댓글

Designed by Tistory.