Giter VIP home page Giter VIP logo

Comments (2)

chobijaeyu avatar chobijaeyu commented on May 25, 2024

Exception has occurred: AttributeError module 'model' has no attribute '__path__' File "/Users/dev/.pyenv/versions/3.6.5/lib/python3.6/site-packages/peewee_migrate/router.py", line 282, in _import_submodules if set(package.__path__) & passed: File "/Users/dev/.pyenv/versions/3.6.5/lib/python3.6/site-packages/peewee_migrate/router.py", line 268, in load_models modules = _import_submodules(module) File "/Users/dev/.pyenv/versions/3.6.5/lib/python3.6/site-packages/peewee_migrate/router.py", line 85, in <listcomp> models = [m for module in modules for m in load_models(module)] File "/Users/dev/.pyenv/versions/3.6.5/lib/python3.6/site-packages/peewee_migrate/router.py", line 88, in create return self.logger.error("Can't import models module: %s", auto) File "/Users/dev/Documents/python/base/pw_migrate.py", line 8, in <module> router.create(auto=model) File "/Users/dev/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/dev/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/Users/dev/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname)

migrate.py
`import model
from peewee_migrate import Router

model.database.connect()

router = Router(model.database,ignore='basemodel')

router.create(auto=model)
router.run

model.database.close()`

I get same error .

from peewee_migrate.

Gaming32 avatar Gaming32 commented on May 25, 2024

I'm still having this exact same issue today.

> pw_migrate create --database "sqlite://db.sqlite3" --auto --auto-source "ab_auth.db" "UUID Primary Key" 
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\pw_migrate.exe\__main__.py", line 7, in <module>
  File "c:\python39\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\python39\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\python39\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python39\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python39\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\python39\lib\site-packages\peewee_migrate\cli.py", line 95, in create
    router.create(name or 'auto', auto=auto_source if auto and auto_source else auto)
  File "c:\python39\lib\site-packages\peewee_migrate\router.py", line 102, in create
    models = [m for module in modules for m in load_models(module)]
  File "c:\python39\lib\site-packages\peewee_migrate\router.py", line 102, in <listcomp>
    models = [m for module in modules for m in load_models(module)]
  File "c:\python39\lib\site-packages\peewee_migrate\router.py", line 305, in load_models
    modules = _import_submodules(module)
  File "c:\python39\lib\site-packages\peewee_migrate\router.py", line 319, in _import_submodules
    if set(package.__path__) & passed:
AttributeError: module 'ab_auth.db' has no attribute '__path__'

EDIT: Removing the --auto switch fixed it.

from peewee_migrate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.