Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
LabelsTower LabelsTower
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MaitresNageurs
  • README
  • LabelsTowerLabelsTower
  • Issues
  • #42

Closed
Open
Created Jul 28, 2020 by Elliot Richard@erichardDeveloper

fix bug : ImportError: module 'demo.config' has no attribute 'Config'

erichard@nb-erichard:~/Developpement/LabelsTower.git$ docker/run_latest.sh instance/init_db.sh

LABELSTOWER_ENV demo.config.Config Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 556, in import_string return getattr(module, obj_name) AttributeError: module 'demo.config' has no attribute 'Config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 558, in import_string raise ImportError(e) ImportError: module 'demo.config' has no attribute 'Config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/work/demo/init.py", line 23, in create_app app.config.from_object(os.environ['LABELSTOWER_ENV']) File "/usr/local/lib/python3.6/site-packages/flask/config.py", line 174, in from_object obj = import_string(obj) File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 563, in import_string ImportStringError, ImportStringError(import_name, e), sys.exc_info()[2] File "/usr/local/lib/python3.6/site-packages/werkzeug/_compat.py", line 147, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 558, in import_string raise ImportError(e) werkzeug.utils.ImportStringError: import_string() failed for 'demo.config.Config'. Possible reasons are:

  • missing init.py in a package;
  • package or module path not included in sys.path;
  • duplicated package or module name taking precedence in sys.path;
  • missing module, class, function or variable;

Debugged import:

  • 'demo' found in '/work/demo/init.py'.
  • 'demo.config' found in '/work/demo/config.py'.
  • 'demo.config.Config' not found.

Original exception:

ImportError: module 'demo.config' has no attribute 'Config' Error: cannot open "Data.sql"

Edited Jul 28, 2020 by Elliot Richard
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking