On Thu, Jan 4, 2018 at 4:43 AM, Abdurrahmane Fourali
<[email protected]> wrote:
>
> I have this error when i passed to python3
> in other side all the modules worked fine with python2 so i don't know why
> thank's for your help
these questions cannot be answered without real code examples in
addition to the error and stack trace you've given, you are referring
to some token "image" that isn't imported when called upon, most
likely within a relationship() construct, something like:
relationship("image.Image", primaryjoin="image.Image.x == somecls.y")
and that can't be found. You need to ensure that the names referred
to in your string are available to those expressions when
configure_mappers() is called.
as far as py2k/py3k, py3k does a lot of things differently but it's
hard to say what is different here without any tangible examples.
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
> Traceback (most recent call last):
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/ext/declarative/clsregistry.py",
> line 281, in __call__
> x = eval(self.arg, globals(), self._dict)
> File "<string>", line 1, in <module>
> NameError: name 'image' is not defined
>
>
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "manage.py", line 24, in <module>
> manager.run()
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/flask_script/__init__.py",
> line 412, in run
> result = self.handle(sys.argv[0], sys.argv[1:])
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/flask_script/__init__.py",
> line 383, in handle
> res = handle(*args, **config)
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/flask_script/commands.py",
> line 216, in __call__
> return self.run(*args, **kwargs)
> File
> "/home/abbdurrahmane/Developper_tools/wilab-cookiecutter-platforme/plateforme3/common/script_commands.py",
> line 14, in run
> db.configure_mappers()
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/orm/mapper.py",
> line 2840, in configure_mappers
> mapper._post_configure_properties()
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/orm/mapper.py",
> line 1765, in _post_configure_properties
> prop.init()
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/orm/interfaces.py",
> line 183, in init
> self.do_init()
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/orm/relationships.py",
> line 1652, in do_init
> self._process_dependent_arguments()
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/orm/relationships.py",
> line 1709, in _process_dependent_arguments
> self.target = self.mapper.mapped_table
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py",
> line 754, in __get__
> obj.__dict__[self.__name__] = result = self.fget(obj)
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/orm/relationships.py",
> line 1625, in mapper
> argument = self.argument()
> File
> "/var/flask_venv/plateforme3/lib/python3.6/site-packages/sqlalchemy/ext/declarative/clsregistry.py",
> line 293, in __call__
> (self.prop.parent, self.arg, n.args[0], self.cls)
> sqlalchemy.exc.InvalidRequestError: When initializing mapper
> Mapper|Product|prd_product, expression 'image.Image' failed to locate a name
> ("name 'image' is not defined"). If this is a class name, consider adding
> this relationship() to the <class 'internal.modules.product.models.Product'>
> class after both dependent classes have been defined.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.