Skip to content

package import, installation, and data download policy - should we make a decision to install a package/make a local copy of data without the user asking? #144

@bact

Description

@bact

Background

Currently (version 1.7.x), some pythainlp modules will install a package/packages automatically if it's not yet installed.

For example:

try:
    import deepcut
except ImportError:
    from pythainlp.tools import install_package
    install_package("deepcut")
    import deepcut

The mechanism may convenient and suitable for use case inside a Jupyter notebook, but may not be ideal for other use cases' environment, like running in a system that's need more control over which package should be in presented in the system.

Proposal

Remove the automatic installation.

Just import the package and let it fails if the package doesn't currently exist in the system.

Rational

The difference here is transparency.

Running code in Jupyter notebook, the user can see the code and see what's currently happening on the cell's output window.

Running code on a server, for example, it is not that visible for the user.

Files/modules that will be affected

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementenhance functionalities

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions