I cloned pydal from github. Then, from the directory where I cloned pydal,
which is ~/work/WikiTrust2/data_interface, I tried to import it.
However, I get an error: I can import DAL, but an import within pydal
itself fails, probably because pydal does not know how to import its own
modules due to Python 3 new import model.
So my question is: if I want to clone pydal from github as a submodule as
part of a larger project, how do I then import pydal into the project?
I am probably confused by the Python 3 import model (I was used to Python
2); can someone help me out?
Many thanks,
Luca
from pydal.pydal import DAL
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-bd4ce315d283> in <module>
----> 1 from pydal.pydal import DAL
~/work/WikiTrust2/data_interface/pydal/pydal/__init__.py in <module>
1 __version__ = '20190915.2'
2
----> 3 from .base import DAL
4 from .objects import Field
5 from .helpers.classes import SQLCustomType
~/work/WikiTrust2/data_interface/pydal/pydal/base.py in <module>
146 from .objects import Table, Field, Rows, Row, Set
147 from .adapters.base import BaseAdapter, NullAdapter
--> 148 from .default_validators import default_validators
149
150 TABLE_ARGS = set(
~/work/WikiTrust2/data_interface/pydal/pydal/default_validators.py in
<module>
10 """
11
---> 12 from . import validators
13
14 def default_validators(db, field):
~/work/WikiTrust2/data_interface/pydal/pydal/validators.py in <module>
29 from functools import reduce
30
---> 31 from pydal._compat import StringIO, integer_types, basestring,
unicodeT, urllib_unquote, \
32 unichr, to_bytes, PY2, to_unicode, to_native, string_types,
urlparse, ipaddress
33 from pydal.objects import Field, FieldVirtual, FieldMethod, Table
ModuleNotFoundError: No module named 'pydal._compat'
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/1d88344a-974b-4551-be43-f06fa83f227c%40googlegroups.com.