General Question regarding Virtual Environments #1272
-
|
I am wondering if there is any way to set a virtual environment as like the default for all VSCode projects or maybe the demos directory or something along those lines? As of now I have to do it every single time I create a new folder which is inconvenient. I also have to reinstall a bunch of things once I set the interpreter to the (myvenv) at the start. I setup the venv using the command on macOS "python3 -m venv myvenv". I read this article: https://levelup.gitconnected.com/how-to-work-with-vs-code-and-virtual-environments-in-python-5aa4f65afb3d I only partially followed this article but I noticed that they mention the requirements.txt file and then they have a bunch of things in there. Is there anyway to acquire one of those for the things we do in this course so then we can download it every time? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
|
Hello @NewCoderrrrr Well the best way to do this is to run vscode from the terminal, instead of opening it using the contextual menu.
Also take something ins consideration, you don't need a new virtualenv for each single project you are going to work on, from lesson 4 to 12 you can just use the same as there are not big changes on packages and dependencies. To create a requirements.txt just use this command (after activate the env you want to export the requirements for):
I did not understand this question could you be more specific please? |
Beta Was this translation helpful? Give feedback.
-
|
This is the way to go: #1109 |
Beta Was this translation helpful? Give feedback.
Hello @NewCoderrrrr
Well the best way to do this is to run vscode from the terminal, instead of opening it using the contextual menu.
Also take something ins consideration, you don't need a new virtualenv for each single project you are going to work on, from lesson 4 to 12 you can just use the same as there are not big changes on packages and dependencies.
To create a requirements.txt just use this command (after activate the env you want to export the requirements for):
pip3 freeze > requirements.txt