Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError tenacity.asyncio #471

Closed
vogre opened this issue Jun 17, 2024 · 15 comments · Fixed by #474
Closed

ImportError tenacity.asyncio #471

vogre opened this issue Jun 17, 2024 · 15 comments · Fixed by #474

Comments

@vogre
Copy link

vogre commented Jun 17, 2024

Using Python 3.11, and latest tenacity 8.4.0

> import tenacity
...
lib/python3.11/site-packages/tenacity/__init__.py", line 653, in <module>
     from tenacity.asyncio import AsyncRetrying  # noqa:E402,I100
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ModuleNotFoundError: No module named 'tenacity.asyncio'
@GabLinares
Copy link

Facing the same issue, seems to be related to a change made in a recent PR

@itok01
Copy link

itok01 commented Jun 17, 2024

I encountered that error too.

This issue can be temporarily worked around by installing older.

pip install 'tenacity==8.3.0'

@Peelz
Copy link

Peelz commented Jun 17, 2024

Also getting this error, fixed by update requirements.txt tenacity>=8.2.3,<8.4.0

dcermak added a commit to SUSE/BCI-tests that referenced this issue Jun 17, 2024
@dpinol
Copy link

dpinol commented Jun 17, 2024

Strange that CI didn't catch it right?

@pmercier
Copy link

Same here with python 3.12.
What is strange is that asyncio is present in the zip and tar.gz package, but abscent when installed with pip or poetry.
image
image

@JeromeDuboisVizzia
Copy link

Hey same error here in a AWS lambda using python 3.12, I didn't encounter it last week :-/

[ERROR] Runtime.ImportModuleError: Unable to import module 'app': No module named 'tenacity.asyncio'
Traceback (most recent call last):

Thanks @Peelz for the workaround

@harupy
Copy link

harupy commented Jun 17, 2024

Encountered the same issue. It looks like the asyncio module is missing:

% zipinfo -1 ~/Downloads/tenacity-8.4.0-py3-none-any.whl
tenacity/__init__.py
tenacity/_utils.py
tenacity/after.py
tenacity/before.py
tenacity/before_sleep.py
tenacity/nap.py
tenacity/py.typed
tenacity/retry.py
tenacity/stop.py
tenacity/tornadoweb.py
tenacity/wait.py
tenacity-8.4.0.dist-info/LICENSE
tenacity-8.4.0.dist-info/METADATA
tenacity-8.4.0.dist-info/WHEEL
tenacity-8.4.0.dist-info/top_level.txt
tenacity-8.4.0.dist-info/RECORD

pyproject.toml or setup.cfg might require updates to include it. Can 8.4.0 be yanked?

dirkmueller added a commit to SUSE/BCI-tests that referenced this issue Jun 17, 2024
pin tenacity to < 8.4.0 as a hotfix for jd/tenacity#471
@JeromeDuboisVizzia
Copy link

tenacity>=8.2.3,<8.4.0

yes, comparing with a previous version (8.3.0), _asyncio.py is missing in the tenacity folder :/

@Tenzer
Copy link

Tenzer commented Jun 17, 2024

The problem is with this line:

packages = tenacity

It isn't recursive so doesn't pick up the tenacity.asyncio package.

The fix is to either specify both packages manually:

packages =
    tenacity
    tenacity.asyncio

or to let setuptools find the packages itself:

packages = find:

@cdce8p
Copy link
Contributor

cdce8p commented Jun 17, 2024

The problem is with this line:

packages = tenacity

Exactly. Opened #474 with a fix.

@wencan
Copy link

wencan commented Jun 17, 2024

This bug prevents llama_index.core from functioning properly.

@kennethpgreen
Copy link

kennethpgreen commented Jun 17, 2024

Hey @jd - see that there's a fix going here: #474. Is it possible to remove the 8.4.0 version in the meantime?

@edgarrmondragon
Copy link

Hey @jd - see that there's a fix going here: #474. Is it possible to remove the 8.4.0 version in the meantime?

Yeah, 8.4.0 should definitely be yanked.

@kennethpgreen
Copy link

Or @sileht ?

@sewcio543
Copy link

Adding MANIFEST.in in root with:
recursive-include tenacity *
would solve the issue as well

@mergify mergify bot closed this as completed in #474 Jun 17, 2024
pirlgon added a commit to dalibo/temboard that referenced this issue Jun 17, 2024
dcermak added a commit to SUSE/BCI-tests that referenced this issue Jun 19, 2024
jd/tenacity#471 is fixed so we can stop requiring
tenacity < 8.4.0 now
rcmadhankumar pushed a commit to SUSE/BCI-tests that referenced this issue Aug 30, 2024
rcmadhankumar pushed a commit to SUSE/BCI-tests that referenced this issue Aug 30, 2024
pin tenacity to < 8.4.0 as a hotfix for jd/tenacity#471
rcmadhankumar pushed a commit to SUSE/BCI-tests that referenced this issue Aug 30, 2024
jd/tenacity#471 is fixed so we can stop requiring
tenacity < 8.4.0 now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.