ImportError: cannot import name 'basestring' from 'pypika.terms'
See original GitHub issueDescribe the bug
excpetion occue when from tortoise.filters import get_m2m_filters
python3.8 x64
Ubuntu 16.04 18.04
To Reproduce
- pip3 install ‘tortoise-orm >=0.16.6’
- from tortoise.filters import get_m2m_filters
Expected behavior No error
Additional context
In [1]: from tortoise.filters import get_m2m_filters
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-4ed7453a3d83> in <module>
----> 1 from tortoise.filters import get_m2m_filters
/usr/local/lib/python3.8/dist-packages/tortoise/__init__.py in <module>
23 OneToOneFieldInstance,
24 )
---> 25 from tortoise.filters import get_m2m_filters
26 from tortoise.models import Model
27 from tortoise.queryset import QuerySet
/usr/local/lib/python3.8/dist-packages/tortoise/filters.py in <module>
5 from pypika import Table
6 from pypika.functions import Upper
----> 7 from pypika.terms import (
8 BasicCriterion,
9 Criterion,
ImportError: cannot import name 'basestring' from 'pypika.terms' (/usr/local/lib/python3.8/dist-packages/pypika/terms.py)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to solve "NameError: name 'basestring' is not defined ...
Resolved this by manually transforming psycopg2 package to a python 3 compatible version running:
Read more >pypika-tortoise · PyPI
pypika, a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query....
Read more >tortoise-orm Changelog - pyup.io
Fix bad import of ``basestring`` - Better handling of NULL characters in strings. Fixes SQLite, raises better error for PostgreSQL.
Read more >name 'basestring' is not defined when invoking ansible2 ...
PYTHON : Unexpected Exception: name ' basestring ' is not defined when invoking ... provided in this video is as it is with...
Read more >Python Examples of inspect.ismethod - ProgramCreek.com
item_func = getattr(self.term, name) if not inspect.ismethod(item_func): ... True except ImportError: # Not testing, no asynctest to import pass while ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi I released 0.16.10 with the fix 😄
Thanks for reporting! I’ll make hotfix for this issue and will be fixed with next release