Skip to content

Core Tutorial 2 got path error #3603

@pickle780

Description

@pickle780

at this page

from gensim import corpora
dictionary = corpora.Dictionary(texts)
dictionary.save('/tmp/deerwester.dict')  # store the dictionary, for future reference
print(dictionary)

got fileNotFoundError

I used below code goes fine

from gensim import corpora
import os

dictionary = corpora.Dictionary(texts)
save_dir = './tmp'
os.makedirs(save_dir, exist_ok=True) 
save_path = os.path.join(save_dir, 'deerwester.dict')
dictionary.save(save_path)
print(dictionary)

By the way I use Python 3.11.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions