Change nltk.download() path directory from default ~/ntlk_data

后端 未结 4 1948
生来不讨喜
生来不讨喜 2021-02-05 07:30

I was trying to download/update python nltk packages on a computing server and it returned this [Errno 122] Disk quota exceeded: error.

Specifi

4条回答
  •  清歌不尽
    2021-02-05 08:02

    According to the documentation:

    By default, packages are installed in either a system-wide directory (if Python has sufficient access to write to it); or in the current user’s home directory. However, the download_dir argument may be used to specify a different installation target, if desired.

    To specify the download directory, use for example:

    nltk.download('treebank', download_dir='/mnt/data/treebank')
    

提交回复
热议问题