简体   繁体   中英

Virtual Environment for FastAPI

A quick question, do we need to create virtual environment for installing and using FastAPI. We use venv for Django right? So why not in FastAPI?

You also can use virtual environment for fastapi projects. This is described in the documentation https://fastapi.tiangolo.com/contributing/#virtual-environment-with-venv .

Creating a virtual environment is necessary to separate your Python packages and is independent of your project.

You can and you should use virtual environments . Usually each project has its own environment.

Some IDEs have automated the process and made it trivial. For example PyCharm asks you during the creation of the project, but you can also do so afterwards.

Yes, you can create a Virtual Environment in FastAPI and maintain your dependencies. Virtual Environments is not Framework dependent. You can use it with any framework.

You should create a virtual environment for each project. You can easily maintain and keep track of your dependencies.

I highly recommend you to use the Anaconda to create and manage the virtual environments

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM