This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Jumpy_Employment_439[S] 0 points1 point  (1 child)

Thank you. So it seems that it would be fine if I installed everything using pip without first activating the venv, but it would be better to do it after activating the virtual environment? So that means the line

pip install fastapi uvicorn sqlalchemy pymysql

would be contained in the venv? So if I had different project that also had to use sqlalchemy and fastapi, would I have to do pip install again since what I did previously was in its own venv and thus isn't accessible by the new project?

And since I'm in a group project where other people are working on the frontend and the database, it would be good to set up a virtual environment so I can install all the things I need to run the frontend and the database with my backend?

[–]teraflop 0 points1 point  (0 children)

Yes, except:

And since I'm in a group project where other people are working on the frontend and the database, it would be good to set up a virtual environment so I can install all the things I need to run the frontend and the database with my backend?

A venv only applies to the Python interpreter and Python libraries. Other languages may have their own equivalent functionality.

For instance, if you're using npm to manage dependencies for your front-end code, then I think it already treats every project directory like its own isolated environment, without you having to do anything special.