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

cannot import name '_tiktoken' from partially initialized module 'tiktoken' #157

Closed
ssSStking opened this issue Apr 4, 2023 · 4 comments

Comments

@ssSStking
Copy link

from tiktoken import _tiktoken
ImportError: cannot import name 'tiktoken' from partially initialized module 'tiktoken' (most likely due to a circular import) (D:\anaconda3\envs\pythonProject\lib\site-packages\tiktoken_init.py)

my tiktoken==0.3.3

@amauryfischer
Copy link

what are your other versions from requirements.txt ?
there is an issue with circular dependencies with googlesearch

@ssSStking
Copy link
Author

ssSStking commented Apr 4, 2023

googlesearch-python is 1.2.2

why other requirements can lead to this error?

here is the content of my tiktoken_init_.py:
"from .core import Encoding as Encoding
from .model import encoding_for_model as encoding_for_model
from .registry import get_encoding as get_encoding
from .registry import list_encoding_names as list_encoding_names"

there no " _tiktoken"

@amauryfischer
Copy link

checkout #98

@Aashishkumar123
Copy link

Upgrade your tiktoken version

pip3 install tiktoken --upgrade

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

3 participants