为什么要将(huggingface)Transformers 库安装在虚拟环境中?
Why should the (huggingface) Transformers library be installed on a virtual environment?
在huggingface github中写着:
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.
为什么要安装在虚拟python环境中?
这样做而不是按原样安装在 python 上有什么好处?
总结社区回答中的评论:
不需要在虚拟环境中安装 huggingface Transformers,它可以像安装任何其他软件包一样安装,尽管使用虚拟环境有很多优点,并且被认为是一种很好的做法。
你想在虚拟环境中完成你所做的所有 Python 工作,这样你就不会干扰 Python 的系统安装,这样你就不会'有一个包含数百个软件包的大型全球列表,这些软件包彼此无关并且可能有相互冲突的要求。
除此之外,为您的项目使用虚拟环境还意味着它可以很容易地部署到不同的机器上,因为所有的依赖项都是独立的,可以一次性打包。
在huggingface github中写着:
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.
为什么要安装在虚拟python环境中? 这样做而不是按原样安装在 python 上有什么好处?
总结社区回答中的评论:
不需要在虚拟环境中安装 huggingface Transformers,它可以像安装任何其他软件包一样安装,尽管使用虚拟环境有很多优点,并且被认为是一种很好的做法。
你想在虚拟环境中完成你所做的所有 Python 工作,这样你就不会干扰 Python 的系统安装,这样你就不会'有一个包含数百个软件包的大型全球列表,这些软件包彼此无关并且可能有相互冲突的要求。
除此之外,为您的项目使用虚拟环境还意味着它可以很容易地部署到不同的机器上,因为所有的依赖项都是独立的,可以一次性打包。