mrbotcr / py3ClimMob

ClimMob is software for agricultural citizen science
https://climmob.net/
GNU Affero General Public License v3.0
5 stars 2 forks source link

module not found when installing plug-ins #220

Closed kongcheng-996 closed 2 years ago

kongcheng-996 commented 2 years ago

Hi,guys When I performed the step alembic revision --autogenerate -m "Initial version" when installing the plug-in, I encountered the problem that the module does not exist. The error is reported as follows:

Traceback (most recent call last):
  File "/home/tank/.local/bin/alembic", line 8, in <module>
    sys.exit(main())
  File "/home/tank/.local/lib/python3.8/site-packages/alembic/config.py", line 588, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/home/tank/.local/lib/python3.8/site-packages/alembic/config.py", line 582, in main
    self.run_cmd(cfg, options)
  File "/home/tank/.local/lib/python3.8/site-packages/alembic/config.py", line 559, in run_cmd
    fn(
  File "/home/tank/.local/lib/python3.8/site-packages/alembic/command.py", line 227, in revision
    script_directory.run_env()
  File "/home/tank/.local/lib/python3.8/site-packages/alembic/script/base.py", line 563, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/home/tank/.local/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 92, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/tank/.local/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 108, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/climmob/plugins/brapi_plugin3/alembic/env.py", line 8, in <module>
    from climmob.models.meta import Base
  File "/home/tank/py3ClimMob/climmob/__init__.py", line 13, in <module>
    from climmob.config.environment import load_environment
  File "/home/tank/py3ClimMob/climmob/config/environment.py", line 13, in <module>
    from climmob.config.routes import loadRoutes
  File "/home/tank/py3ClimMob/climmob/config/routes.py", line 7, in <module>
    from climmob.views.basic_views import (
  File "/home/tank/py3ClimMob/climmob/views/basic_views.py", line 4, in <module>
    from climmob.views.classes import publicView
  File "/home/tank/py3ClimMob/climmob/views/classes.py", line 15, in <module>
    from climmob.processes import (
  File "/home/tank/py3ClimMob/climmob/processes/__init__.py", line 5, in <module>
    from climmob.processes.db.project import *
  File "/home/tank/py3ClimMob/climmob/processes/db/project.py", line 25, in <module>
    from climmob.models.repository import sql_fetch_all, sql_fetch_one
  File "/home/tank/py3ClimMob/climmob/models/repository.py", line 2, in <module>
    from climmob.config.celery_app import get_ini_value
ModuleNotFoundError: No module named 'climmob.config.celery_app'

The project is cloned in the directory /home/tank/py3climmob. And I have already executed sudo python3 setup.py develop in this directory. And get corresponding feedback. Finished processing dependencies for climmob==3.5.0

Looking forward to your help. Thank you.

BrandonMrBot commented 2 years ago

Hi @kongcheng-996 ,

In the root of the project (/home/tank/py3climmob) and with the ClimMob environment activated run the script configure_celery.py:

python configure_celery.py ./development.ini

This will create a file called celery_app.py in the directory /home/tank/py3climmob/climmob/config/