Should I create a directory in my virtualenv and save the source code for that specific project there?
Thanks in advance
Should I create a directory in my virtualenv and save the source code for that specific project there?
Thanks in advance
You're not required to have them related in any way. As long as your env is activated, it doesn't matter where it is.
But what's usually easiest is:
src
directory under that project directory (or, for really simple projects, just drop it in the project directory).That way you can check the env settings into version control alongside your code, and if you use an auto-venv tool it'll activate the env every time you cd
into the project directory, and so on.
As a side note, if you're just learning this stuff today, you might want to consider learning pipenv
instead of using raw virtual environments.
You can save your project anywhere. But you should activate the virtual environment before working on that project.
You can activate the virtual environment using the following command.
source path-to-virtualenvironment/bin/activate
After activating the virtual environment move to your project location.