Importerror:no module named App_factory

Source: Internet
Author: User

1importerror:no module named App_factory

The following error occurred while running a wsgi -related program in python :

[Email protected]:~/python$ python wsgi_paste.py

Traceback (most recent):

File "wsgi_paste.py", line A, in <module>

Wsgi_app = Loadapp (' config: ' +ini_path)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in Loadapp

Return Loadobj (APP, Uri, Name=name, **kw)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 271, in Loadobj

global_conf=global_conf)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in Loadcontext

global_conf=global_conf)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line +, in _loadconfig

Return Loader.get_context (object_type, name, global_conf)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 458, in Get_context

Section

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 517, in _context_from_explicit

Value = import_string (found_expr)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line A, in import_string

Return pkg_resources. Entrypoint.parse ("x=" + s). Load (False)

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load

Entry = __import__ (Self.module_name, Globals (), Globals (), [' __name__ '])

File "/home/cast503/python/wsgi_paste.py", line A, in <module>

Wsgi_app = Loadapp (' config: ' +ini_path)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in Loadapp

Return Loadobj (APP, Uri, Name=name, **kw)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 271, in Loadobj

global_conf=global_conf)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in Loadcontext

global_conf=global_conf)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line +, in _loadconfig

Return Loader.get_context (object_type, name, global_conf)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 458, in Get_context

Section

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 517, in _context_from_explicit

Value = import_string (found_expr)

File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line A, in import_string

Return pkg_resources. Entrypoint.parse ("x=" + s). Load (False)

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load

Entry = __import__ (Self.module_name, Globals (), Globals (), [' __name__ '])

Importerror:no module named App_factory

According to the error prompt has been on the internet search app_factory module, not found, and finally carefully review the code, found in the project configuration file api-paste.ini ": "written. " ".

The correct configuration should be:

[App:hello]

Paste.app_factory = App:app_factory

Error configuration:

[App:hello]

Paste.app_factory = App.app_factory


Importerror:no module named App_factory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.