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

No module named 'tenacity.asyncio' #766

Closed
1 task done
axfrl opened this issue Jun 17, 2024 · 4 comments
Closed
1 task done

No module named 'tenacity.asyncio' #766

axfrl opened this issue Jun 17, 2024 · 4 comments

Comments

@axfrl
Copy link

axfrl commented Jun 17, 2024

  • This is actually a bug report.

Hello,
I try to import instructor 1.3.3 in my notebook run on an azure cluster(spark 3.5, scala 2.12).
I have the latest openai library (1.34.0).

I always have this error message:
ModuleNotFoundError: No module named 'tenacity.asyncio'
[...]
-->653 from tenacity.asyncio import AsyncRetrying # noqa:E402,I100

@rishav1122
Copy link

yeah, same error
I have also installed tenacity 8.4.0

@fer-git
Copy link

fer-git commented Jun 17, 2024

I think the issue is on tenacity here, you need to update it to 8.4.1
https://github.com/jd/tenacity/releases/tag/8.4.1

@ivanleomk
Copy link
Collaborator

@fer-git thanks for catching this, managed to reproduce this issue. I'll try to publish a fix soon for this

(instructor) ivanleo@Ivans-MacBook-Pro instructor % uv pip install tenacity==8.4.0                               
Resolved 1 package in 30ms
Installed 1 package in 2ms
 - tenacity==8.4.1
 + tenacity==8.4.0
(instructor) ivanleo@Ivans-MacBook-Pro instructor % python3 test.py                                              
Traceback (most recent call last):
  File "/Users/ivanleo/Documents/coding/instructor/test.py", line 1, in <module>
    import instructor
  File "/Users/ivanleo/Documents/coding/instructor/instructor/__init__.py", line 15, in <module>
    from .patch import apatch, patch
  File "/Users/ivanleo/Documents/coding/instructor/instructor/patch.py", line 17, in <module>
    from instructor.retry import retry_async, retry_sync
  File "/Users/ivanleo/Documents/coding/instructor/instructor/retry.py", line 18, in <module>
    from tenacity import AsyncRetrying, RetryError, Retrying, stop_after_attempt
  File "/Users/ivanleo/Documents/coding/instructor/.venv/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'
(instructor) ivanleo@Ivans-MacBook-Pro instructor % uv pip install tenacity==8.4.1
Resolved 1 package in 1ms
Installed 1 package in 2ms
 - tenacity==8.4.0
 + tenacity==8.4.1
(instructor) ivanleo@Ivans-MacBook-Pro instructor % python3 test.py               
name='Jason' age=25

@ivanleomk
Copy link
Collaborator

@fer-git tenacity is now set to min 8.4.1 in instructor 1.3.5 so closing this issue!

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

No branches or pull requests

4 participants