question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name 'basestring' from 'pypika.terms'

See original GitHub issue

Describe the bug excpetion occue when from tortoise.filters import get_m2m_filters python3.8 x64 Ubuntu 16.04 18.04

To Reproduce

  1. pip3 install ‘tortoise-orm >=0.16.6’
  2. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
grigicommented, Apr 30, 2020

Hi I released 0.16.10 with the fix 😄

2reactions
lntuitioncommented, Apr 29, 2020

Thanks for reporting! I’ll make hotfix for this issue and will be fixed with next release

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found