HOW TO RESOLVE THIS AttributeError: module 'tiktoken' has no attribute 'get_encoding'

HOW TO RESOLVE THIS ?

AttributeError: module ‘tiktoken’ has no attribute ‘get_encoding’

docs = SimpleDirectoryReader(path).load_data()

print(docs)

llmp = LLMPredictor(
llm=OpenAI(
temperature=0,
model_name=“text-davinci-003”,
max_tokens=1000,
frequency_penalty=0.1,
presence_penalty=0.0,
)
)

max_input_size = 512
num_output = 512
max_chunk_overlap = 20
sizew = 600
prompt_helper = PromptHelper(max_input_size,max_chunk_overlap,chunk_size_limit=sizew)

service_context = ServiceContext.from_defaults(
llm_predictor=llmp, prompt_helper=prompt_helper
)
vectorINdex = GPTSimpleVectorIndex.from_documents(docs, service_context=service_context)

vectorINdex.save_to_disk(“dataemd.json”)

print(vectorINdex)

Hi, did anyone encounter this error and solved it?
Any help would be appreciated

Maybe you are naming your script as “token.py” or something that might make it look for the wrong component. Take a look at the last lines of the error, it will probably point you in the right direction.

Just try to rename the script to something different and try again.