Why should the  (huggingface) Transformers library be installed on a virtual environment?
In the huggingface github it is written:

You should install  Transformers in a virtual environment. If you're
unfamiliar with Python virtual environments, check out the user guide.
Create a virtual environment with the version of Python you're going
to use and activate it.
Now, if you want to use  Transformers, you can install it with pip.
If you'd like to play with the examples, you must install it from
source.

Why should it be installed in a virtual python environment?
What are the advantages of doing that rather than installing it on python as is?

Summing up the comments in a community answer:

It's not needed to install huggingface Transformers in a virtual environment, it can be installed just like any other package though there are advantages of using a virtual environment, and is considered a good practice.


You want to work in virtual envs for all Python work you do, so that you don't interfere the system install of Python, and so that you don't have a big global list of hundreds of packages that have nothing to do with each other and that may have conflicting requirements.
Apart from that, using a virtual environment for your project also means that it is easily deployable to a different machine, because all the dependencies are self-contained and can be packaged up in one go.


More in this answer
